Microsoft Small Basic

Program Listing: GCB020
TextWindow.WriteLine("1 to eat, 2 to drink, 3 to sleep. Don't die.")
start:
TextWindow.WriteLine(i)
i = i + 1
a = Controls.AddTextBox(0,0)
rand = Math.GetRandomNumber (3)
If rand = 1 Then
TextWindow.WriteLine("You are hungry.")
Program.Delay(5000)
EndIf
If rand = 1 Then
hft = Controls.GetTextBoxText(a)
EndIf
If rand = 1 And hft = (1) then
TextWindow.WriteLine("You are no longer hungry.")
Goto start
EndIf
If rand = 2 Then
TextWindow.WriteLine("You are thirsty.")
Program.Delay(5000)
EndIf
If rand = 2 Then
hft = Controls.GetTextBoxText(a)
EndIf
If rand = 2 And hft = (2) then
TextWindow.WriteLine("You are no longer thristy.")
Goto start
EndIf
If rand = 3 Then
TextWindow.WriteLine("You are tired.")
Program.Delay(5000)
EndIf
If rand = 3 Then
hft = Controls.GetTextBoxText(a)
EndIf
If rand = 3 And hft = (3) then
TextWindow.WriteLine("You are no longer tired.")
Goto start
EndIf