Download presentation
Presentation is loading. Please wait.
1
Branching with Random Numbers
5
Branching with Random Numbers
In the previous version of this world, we asked the user for input to determine who would jump. In this exercise, you will have the computer randomly select who will jump.
6
Random numbers in Alice
Alice has a world function that will return a random number in a specified range. The numbers it returns are six-digit numbers The numbers are >= to the lower bound specified and < the upper bound specified.
20
Random numbers returned
Alice will return numbers such as: 0 <= X < 3
21
Modify our If/Else If the random number is < 1, Alice jumps
If > 1 but < 2, the White Rabbit jumps If >= 2 but < 3, the Cheshire Cat jumps
22
What goes here?
26
?
28
Alternate strategy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.