It's past your bedtime! Let's count some sheep to lull you to sleep.
-
Generate a random number between 1 and 10 to represent the number of sheep needed to fall asleep.
-
Set a variable called
awake
toTrue
-
Using a
while
loop, count sheep until you fall asleep -
Fall asleep by setting
awake
toFalse
Output
1 sheep - baa!
2 sheep - baa!
3 sheep - baa!
4 sheep - baa!
5 sheep - baa!
6 sheep - baa!
7 sheep - baa!
8 sheep - baa!
9 sheep - baa!
...zZzZzZzZ...