//A Rock, Paper and Scissors simulator
list.any = function()
return self[rnd * self.len]
end function
list = ["Rock", "Paper", "Scissors"]
choice = list.any
print "Type ""Rock"", ""paper"" or ""Scissors"" and see if you win!"
pap = input("Rock, paper, scissors, shoot!")
print "You choose " + pap.upper + "!"
print "The opponent choose " + choice.upper + "!"
if choice.upper == "ROCK" and pap.upper == "SCISSORS" then
print "Rock crushes Scissors! OPPONENT WINS!"
else if choice.upper == "ROCK" and pap.upper == "ROCK" then
print "A TIE!"
else if choice.upper == "PAPER" and pap.upper == "ROCK" then
print "Paper covers Rock! OPPONENT WINS!"
else if choice.upper == "PAPER" and pap.upper == "PAPER" then
print "A TIE!"
else if choice.upper == "SCISSORS" and pap.upper == "SCISSORS" then
print "A TIE!"
else if choice.upper == "SCISSORS" and pap.upper == "PAPER" then
print "Scissors cuts Paper! OPPONENT WINS!"
else if pap.upper == "ROCK" and choice.upper == "SCISSORS" then
print "Rock crushes Scissors! YOU WIN!"
else if pap.upper == "SCISSORS" and choice.upper == "PAPER" then
print "Scissors cuts Paper! YOU WIN!"
else if pap.upper == "PAPER" and choice.upper == "ROCK" then
print "Paper covers Rock! YOU WIN!"
end if