var x, y, numb, button, score : int
var ch : string (1)
score := 0
put "You will see a random number...then a big box will appear..."
put "Remember that number you saw at the beginning, because that"
put "is how many times you will hit the big box...When the number"
put "of times you have hit the big box matches the number at the beginning"
put "then hit the smaller box. For example...If you see a 6 at the beginning"
put "then hit the big box 6 times, and then hit the smaller box!"
put ""
put "Hit a key to continue!"
getch (ch)
cls
randint (numb, 1, 15)
put "The number is ", numb
delay (1200)
cls
loop
mousewhere (x, y, button)
drawfillbox (100, 270, 300, 56, 7)
if x > 100 and x < 300 and y > 56 and y < 270 and button = 1 then
score := score + 1
delay (300)
View.Update
cls
put "You have hit the square ", score, " times"
end if
mousewhere (x, y, button)
drawfillbox (570, 340, 500, 410, 7)
if x > 500 and x < 570 and y > 340 and y < 410 and score = numb and button = 1 then
put "Good!"
delay (900)
exit
elsif x > 500 and x < 570 and y > 340 and y < 410 and button = 1 then
delay (300)
put "The number of times you have hit the square"
put "does not match the random number at the beginning!"
delay (2200)
cls
end if
end loop
put "You have won!"
delay (900)
cls
|