Microsoft Small Basic

Program Listing:
Embed this in your website
'Neil Busse

Playing = "True"
While Playing' = "True" 'If Playing <> "True" Then GoTo end

  TextWindow.WriteLine("Guess a number between 1-100")
  guess = Math.GetRandomNumber(100)
  NotCorrect = "True"
  numguess = 0
  While NotCorrect' = "True" 'If Not Correct <> "True" Then GoTo end2

    num2 = TextWindow.ReadNumber()

    numguess = numguess + 1
    'If the number is greater then the Random number then To high else to low.

    If num2 > guess Then
      TextWindow.WriteLine("Your guess is too high")
    ElseIf num2 < guess Then
      'If the you the right number then the program will tell you won.
      TextWindow.WriteLine("Your guess is too low")
    Else'If num2 = guess Then
      If numguess = 1 Then
        TextWindow.WriteLine("It took you: 1 try")
        TextWindow.WriteLine("It took you: " + numguess + " tries")
      NotCorrect = "False"
  EndWhile 'GoTo start2
  TextWindow.WriteLine("Do you want to play again? (y, n)")
  yes = TextWindow.ReadKey()
  If yes = "y" Then
    'Get new random number, and reset number of guesses then loop.
  Else'If yes <> "n"
    'if player doesnt want to play again then program close
    Playing = "False"
EndWhile 'GoTo start
Copyright (c) Microsoft Corporation. All rights reserved.