-
Notifications
You must be signed in to change notification settings - Fork 1
Number Guessing Game
Daniel Gamboa edited this page Jan 28, 2017
·
11 revisions
Be a psychic and guess what number the computer is thinking!
Extracts routine to a function to reuse code. Convey the practicality and advantages of reusing code, clarity of modularity. This is the guessing game where players must guess a randomly chosen number (1-100). They get 7 guesses to find the number. Players are asked to guess a number and then are told whether the number is higher or lower than the real number. Initially we don't tell them how many guesses it will take and we will ask them to guess.
- Loops
- Functions