Free Pascal Lazarus Program Tutorial 14 - Guess My Number Game



At this point in the tutorial series, we can start putting programs together from the previous tutorials.

We will use the classic game Guess My Number. It is a very boring game to play, by today’s standards, but programing the game can be interesting.

Guess My Number is also called the Guessing Game.

The requirements of the game
The game will prompt the user to select one of three games. The games are 1-10, 1-100, 1-1000. If the user does not enter the right selection,
the program will display the selection again. Once the user selects the game, the program will randomize the number and prompt the user for a guess. The guess will be checked with the computer’s number. If the guess was not correct, the computer will prompt the user to guess higher or lower. If the guess was correct, the computer will display the number of times the user guessed, and the game will be over. The computer will prompt the user to play again. If the user does want to play again, the program will return to the game menu. If the user does not want to play again, the computer will quit the program.

Code Download
FPProgT14.zip