Thursday, December 09, 2004

Guessing Game Program

Here is the output that should be given by the Guessing Game program:
~~~~~~~~~~~~~~

This is a game where you try to guess my number in as few tries as possible.

You need to tell me the range of numbers to pick a number in, then you will guess it.

What number should be the lowest possible?
?
What number should be the highest possible?
?

What is your guess?
?
That's too high.

What is your guess?
?
That's too low.

What is your guess?
?
You got it in only _ tries.

~~~~~~~~~~~~~
A random number between the two numbers picked should be chosen, then the program should continue taking guesses until the correct answer is guessed. After each guess tell whether the number is too high or too low. As a bonus, display a different message if they guess a number that is not in the original range. When the number is finally guessed, be sure to tell how many guesses it took.

Another bonus would be to ask if the user wants to play another game.

The text does not need to be exact, but the basic message should be same.

No comments: