Java Simple Game 1

Task: Create a simple text game.

Requirements:

  • Use Scanner to get user input from the terminal.
  • Design a win condition and a lose condition for your game.
  • Create boolean variables to store whether the game has been won or lost yet.
  • Use a while loop to keep running game turns until the player has either won or lost.
  • Notify the player when they have won or lost.

Bonus Content:

  • After the game ends, ask if they want to play again. If they do, repeat the game. Tip: make the game a separate method, and put another while loop in your main() method that can keep restarting the game.
  • Keep score in an int variable and tell the player their score each turn.
  • Incorporate random numbers to make the game more interesting.