Objective
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.
Skills Required
- Console I/O
- Random number generation
- IDE familiarity
- Basic types
- If statements
- Equality operators
- Loops
Iterations
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.
-
Stretchier task: Set up some kind of point system
-
Stretchier stretchier task: Have your point system fluctuate depending on how many attempts it took to get the correct answer