?
2010-03-24 10:28:03 UTC
Then, do the following steps :
Print out the word "GUESS", and input a guess from the keyboard
into a suitable variable name, say Guess.
WHILE Guess is not equal to SECRET do
BEGIN
Add 1 to the number of guesses (Use a suitable variable name)
Tell the user whether her guess is too high or too low.
Input the next Guess.
END;
Now, just output a message (like WOW! You got it!)
and tell the user how many guesses they took (that is, write out
the value of the variable you had used for this purpose).
Random number generation : Use the builtin function random to generate random numbers. Do
randomize;
secret := random(100) + 1;
early in your program to generate the secret number.