Author | curiouscat |
Submission date | 2012-12-21 03:37:13.740978 |
Rating | 1782 |
Matches played | 732 |
Win rate | 15.16 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "": # initialize variables for the first round
output = random.choice(["R","P","S"])
last = random.choice(["R","P","S"])
elif input == "R" and last == "R":
output = "S"
elif input == "P" and last == "P":
output = "R"
elif input == "S" and last == "S":
output = "P"
else:
output = random.choice(["R","P","S"])
last=input