Guessing Game

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!

  1. When the user guesses 7, the game announces they have won. All other numbers lose.

  2. When the user guesses 0, the game provides instructions for the user.

  3. After guessing, the user can take one more guess (unless they won!)

  4. When the user guesses -1, the application should exit.

  5. The game should provide feedback that the secret number is > or < any incorrect guesses.

  6. The number should be random, instead of always 7.

  7. Stretch task: Give the user 3 tries before announcing they have lost.

  8. Stretchier task: Set up some kind of point system

  9. Stretchier stretchier task: Have your point system fluctuate depending on how many attempts it took to get the correct answer