Author | duxing207 |
Submission date | 2013-10-05 03:19:54.286071 |
Rating | 3089 |
Matches played | 618 |
Win rate | 28.8 |
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","R","R","P","S","S"])
elif output == "P":
output = random.choice(["R","R","P","P","P","S"])
else:
output = random.choice(["R","R","P","P","P","S"])
elif input == "P":
if output == "R":
output = random.choice(["R","R","P","P","P","S"])
elif output == "P":
output = random.choice(["R","R","P","P","P","S"])
else:
output = random.choice(["R","P","P","P","S","S"])
else:
if output == "R":
output = random.choice(["R","R","R","P","S","S"])
elif output == "P":
output = random.choice(["R","R","P","P","P","S"])
else:
output = random.choice(["R","P","P","P","S","S"])