2

BUILD A HI-LO GUESSING GAME APP!

Image

Let’s begin by coding a fun, playable game in Java: the Hi-Lo guessing game. We’ll program this game as a command line application, which is just a fancy way of saying it’s text based (see Figure 2-1). When the program runs, the prompt will ask the user to guess a number between 1 and 100. Each time they guess, the program will tell them whether the guess is too high, too low, or correct.

Image

Figure 2-1: A text-based Hi-Lo guessing game

Now that you know how the game works, all you have to do is code the steps to ...

Get Learn Java the Easy Way now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.