Try to complete all the iterations listed below. Don't worry if you get stuck on one of them, we will review them tomorrow.
For Tuesday, work on iterations 1-6.
For Wednesday work on the stretch task.
Create a command line based number guessing game, where users have to guess a number between 1 and 10. Build the application in a series of iterations, with each iteration being a functional (though incomplete) version of the final application.
- Console I/O
- Random number generation
- IDE familiarity
- Basic types
- If statements
- Equality operators
- Loops
Build the application in the following small iterations. It should function at completion of each iteration!
- When the user guesses 7, the game announces they have won. All other numbers lose.
- When the user guesses 0, the game provides instructions for the user.
- After guessing, the user can take one more guess (unless they won!)
- When the user guesses -1, the application should exit.
- The game should provide feedback that the secret number is > or < any incorrect guesses.
- The number should be random, instead of always 7.
Stretch task: Give the user 3 tries before announcing they have lost.