Author | duxing2007 |
Submission date | 2013-10-05 03:25:58.317857 |
Rating | 3422 |
Matches played | 674 |
Win rate | 35.91 |
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"])
elif input == "R":
if output == "R":
output = random.choice(["R","P","P","P","S","S"])
elif output == "P":
output = random.choice(["R","R","R","P","S","S"])
else:
output = random.choice(["R","R","R","P","S","S"])
elif input == "P":
if output == "R":
output = random.choice(["R","R","R","P","S","S"])
elif output == "P":
output = random.choice(["R","R","R","P","S","S"])
else:
output = random.choice(["R","R","R","P","S","S"])
else:
if output == "R":
output = random.choice(["R","P","P","P","S","S"])
elif output == "P":
output = random.choice(["R","R","R","P","S","S"])
else:
output = random.choice(["R","R","R","P","S","S"])