Number guesser

This is a simple guessing game. The computer picks a random number, and the user has to guess what it is in as few goes as possible.

By default, the computer picks a number between 1 and 100, but the user can specify a different maximum number by specifying it as the command line (see usage below).

Programming Issues

The following issues are involved:

Usage

Run the program by typing:

guesser

for a number between 1 and 100. To specify a different maximum number, use:

guesser 20

where the computer will pick a number between 1 and 20 (or whatever number you specify).

Source and Downloads