2016-02-20

Higher Lower: a simple Java game

For my previous job, I had to travel a lot. While travelling, I liked to play simple games that do not need a mouse. In the lack of having many games on my laptop, I programmed some to kill time. One of these games was 'Higher Lower'; a game of guessing a random number in a predefined range.

The game was just a little exercise about the usage of the System's input stream (System.in) and it turned out to be quite straight forward. Just wrap a reader around it:
And start reading lines entered by the user:
:D
The full source code and runnable jar can be found here. To run the jar, you need Java 1.8.0 or later, and execute the command 'java -jar higherlower.jar'.