TDK, first off I have to compliment you on the great tutorial on Variables! You made it so easy to understand them. Thanks!
Now, I took up your 'test' about making the number game, modified it to be what I wanted, and had a blast making it!
Problem is, it freezes up after the player guesses the right number.
I can't find anything that looks suspicious about the code...is it supposed to freeze and I have to figure it out? If so, no problem.
Here's the code just in case it's NOT supposed to do that...
Rem Setup Sync
Sync On
Sync Rate 30
Rem create menu
CLS rgb(0,0,0)
Set Text Font "Denmark"
Set Text Size 20
Set Text Transparent
ink rgb(255,255,255),0
Text 220,0, "The Number Game"
Sync
Set Text Font "Denmark"
Set Text Size 20
Set Text Transparent
ink rgb(255,255,255),0
Text 200,12, "Press Any Key to Continue!"
Sync
Wait Key
Rem please type in your name
CLS rgb(0,0,0)
Print "Please Type in your name: ";
Input Name$
CLS
Print "Hello "; Name$ ;"! Welcome to the Number Game!"
Rem Start Game
CLS rgb(0,0,0)
Randomize Timer(): Rem Initialise the random number generator
Start:
MyNumber=Rnd(9)+1: Rem Select a random number between 1 and 10
Do: Rem Main Program Loop
CLS: Rem Clear the screen
Print Name$ ;" , I have thought of a number between 1 and 10. See how quickly you can guess it!"
Print
Input "What is your guess? ",Guess
Print
If Guess < MyNumber: Rem If chosen number is lower than computer's number
Print "Your guess was too low, "; Name$ ;". Try again."
Sleep 2000
Endif
If Guess > MyNumber: Rem If chosen number is higher than computer's number
Print Name$ ;", your guess was too high. You LOSE!! Just Kidding!"
Sleep 2700
Endif
If Guess = MyNumber: Rem If chosen number is equal to computer's number
Print "Your guess was correct. Well done!!"
Print "Do you want to play again (Y/N)?"
Repeat: Rem Repeat...Until loop repeats until Y or N key is pressed
I$=Upper$(Inkey$()): Rem Read the keyboard for keypresses
Until I$="Y" or I$="N"
If I$="Y": Rem If Y was pressed
Goto Start: Rem Jump to Start label at beginning of program
Else
CLS: Rem Clear the screen
Print "Goodbye,"; Name$ : Rem Print Goodbye message
End: Rem End the program
Endif
Endif
Loop
Thanks for pointing me in the direction of the tutorials!
EDIT: Found out it was supposed to happen...lol.