Microsoft Small Basic

Program Listing: GUESS
'Guess My Number

start:
TextWindow.Clear()
round2 = 10
round = 0
number2 = Math.GetRandomNumber(100)
TextWindow.Title = "Guess My Number"
TextWindow.ForegroundColor = "Red"
TextWindow.Writeline("Guess My Number")
TextWindow.ForegroundColor = "Gray"
TextWindow.WriteLine("")
TextWindow.WriteLine("My number is less than 100.")
TextWindow.WriteLine("You have " + round2 + " rounds")
begin:
TextWindow.Write("What's my number? ")
number = textwindow.ReadNumber()
If number = number2 Then
TextWindow.WriteLine("You Won!")
TextWindow.Write("Would you like to play again? y/n ")
playagain = TextWindow.Read()
If playagain = "y" Or playagain = "Y" Or playagain = "Yes" Or "yes" Or playagain = "YES" Then
Goto start
Else
Program.End()
endif

Else
If number < number2 Then
TextWindow.WriteLine(number + " is Too Small")
Else
TextWindow.WriteLine(number + " is Too Large")
endif
If ((round2 - round) - 1) > 1 Then
round3 = "rounds"
else
round3 = "round"
endif
TextWindow.WriteLine("You have " + ((round2 - round) - 1) + " " + round3 + " left")
TextWindow.WriteLine("")
Endif
round = round + 1
If round < round2 Then
Goto begin
else
Textwindow.WriteLine("You have run out of rounds")
TextWindow.Write("Would you like to play again? y/n ")
playagain = TextWindow.Read()
If playagain = "y" Or playagain = "Y" Or playagain = "Yes" Or playagain = "yes" Or playagain = "YES" Then
Goto start
Else
Program.End()
endif
EndIf