Made some changes. You mainly forgot the
endcase separating each case and had an extra "=" in yout
until line.
I added some color to the text and a subroutine that lets the player know if their guess was "too high" or "too low".
<any key> plays another game.
[ESC] exits the game.
DO
cls
Randomize (Timer ())
MyRandomNumber = RND(10)
ink 0xFFBBBB00,0
Print "Numbers are between 0 and 10 you have three tries to get it right"
GameState = 0
NumberOfTries = 0
Repeat
Rem// Inc stands for increase.
Inc NumberOfTries
ink 0xFFFFFFFF
Select NumberOfTries
Case 1
Input "Hi! This is your first guess, good luck! ", MyGuess
If Myguess = MyRandomNumber
ink 0xFF00BB00
Print "Wow on your first go! Well Done"
GameState = 1
Else
gosub HiLo
ink 0xFF0000BB
Print "Try Again":Print
Endif
Endcase
Case 2
Input "Hi! This is your second guess good luck! ", MyGuess
If Myguess = MyRandomNumber
ink 0xFF00BB00
Print "Wow on your second go! Well Done"
GameState = 1
Else
gosub HiLo
ink 0xFF0000BB
Print "Try Again":Print
Endif
Endcase
Case 3
Input "Hi! This is your last guess, good luck! ", MyGuess
If Myguess = MyRandomNumber
ink 0xFF00BB00
Print "Third time's the charm!!!"
GameState = 1
Else
ink 0xFF0000BB
Print "Im sorry you are out of guesses, you lose"
GameState = 1
Endif
EndCase
Case Default
Print "An Error Has Occured some how number of tries is out of bounds"
EndCase
EndSelect
Until GameState=1
Print : Print
ink 0xFF008888
Print "Press [ESC] To Exit Game"
Print "or"
Print "Press <any other key> To Try Again"
wait key
LOOP
End
HiLo:
if MyGuess < MyRandomNumber
ink 0xFFBB0000
print "Your guess is too low."
else
ink 0xFFBB0000
print "Your guess is too high."
endif
return
Your signature has been erased by a mod please reduce it to 600 x 120.
