Author | pyfex |
Submission date | 2011-06-09 11:09:41.872319 |
Rating | 5881 |
Matches played | 5362 |
Win rate | 57.96 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
played = []
output = random.choice(['R', 'P', 'S'])
else:
played.append(input)
expected = random.choice(played)
output = {'P': 'S', 'R': 'P', 'S':'R'}[expected]