Author | Shawn |
Submission date | 2011-06-10 19:36:30.420069 |
Rating | 2057 |
Matches played | 5223 |
Win rate | 21.75 |
Use rpsrunner.py to play unranked matches on your computer.
import random;
# assume they won't usually roll the same item twice in a row
if input == "R":
output = random.choice(["R","S"]);
elif input == "P":
output = random.choice(["R","P"]);
elif input == "S":
output = random.choice(["P","S"]);
else:
# first throw
output = random.choice(["R","P","S"]);