Microsoft Small Basic

Program Listing: bnt936
'Rock Paper Scissors Game
'Uses Goto Statements


start:
TextWindow.Clear()
TextWindow.Write("Player 1, do you choose Rock, Paper, or Scissors?")
player1=TextWindow.Read()
player1=Text.ConvertToUpperCase(player1)

TextWindow.Clear()

TextWindow.Write("Player 2, do you choose Rock, Paper, or Scissors?")
player2=TextWindow.Read()
player2=Text.ConvertToUpperCase(player2)

If (player1="ROCK" Or player1="PAPER" Or player1="SCISSORS") and (player2="ROCK" Or player2="PAPER" Or player2="SCISSORS") Then
Goto check
Else
TextWindow.WriteLine("Invalid entry. Try again.")
Program.Delay(1000)

Goto start
EndIf

check:

If player1 = player2 Then
TextWindow.WriteLine("It's a tie")
ElseIf (player1 = "ROCK" And player2 = "PAPER") or (player1 = "PAPER" And player2 = "SCISSORS") or (player1 = "SCISSORS" And player2 = "ROCK") Then
TextWindow.WriteLine("Player 2 Wins! "+Player2+" beats "+player1)
Else
TextWindow.WriteLine("Player 1 Wins! "+Player1+" beats "+player2)
EndIf