You are on page 1of 1

Stella Connaughton

10.20.15
Explanation

To create this program, I had to be able to use the function choose true
(probabilityOfTrue) of the time. I set probabilityOfTrue to 0.7. I then created an
If/Else control statement for the custom method. I set If choose true (0.7) of the
time, and underneath put the code in so that bikeKid will move forward. Therefore,
I wrote that 70% of the time, bikeKid will move forward 5 meters. For the Else
statement, I put that he orients himself to the road, so he faces the direction of the
other road, and he moves forward, so he makes a turn. Since 70% of the time he
will move forward, 30% of the time he will make a turn.

You might also like