Author | pyfex |
Submission date | 2011-06-10 19:13:40.852446 |
Rating | 5785 |
Matches played | 5412 |
Win rate | 54.9 |
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[-16:])
output = {'P': 'S', 'R': 'P', 'S':'R'}[expected]