|
Clear the screen
Define variables
Assign a random value to
variable tobefound
Set variable counter to zero
Write "Try to guess the correct number"
on screen
DO
Ask user to enter his choice
Store choice in variable
choice
Increment the counter by
1
Check whether variable
tobefound is less than variable choice. If so say "number is
smaller"
Check whether variable
tobefound is greater than variable choice. If so say "number is
greater"
LOOP UNTIL choice = tobefound
Tell user how much moves were needed to succeed
|