Presentation is loading. Please wait.

Presentation is loading. Please wait.

This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes.

Similar presentations


Presentation on theme: "This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes."— Presentation transcript:

1 This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes.

2

3

4

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 ==.

8

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.

11


Download ppt "This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes."

Similar presentations


Ads by Google