Download presentation
Presentation is loading. Please wait.
Published byΚῆρες Γερμανού Modified over 5 years ago
1
This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes.
5
In this example I have a loop which allows me to guess repeatedly until I get the correct answer. Each guess is evaluated by comparing the guess to a random number generated by JavaScript. The guess is evaluated for matching the random number, greater than the random number of less then the random number.
6
This shows three guesses - one was to high, one was too low and one matched.
7
This slide answers a question about the = versus the ==.
9
it would be possible to never execute the loop
it would be possible to never execute the loop. The second in red shows doing the loop once and then asking whether or not to do it again. The loop will always be executed once.
10
do it again.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.