Author | kyle morrison |
Submission date | 2011-06-09 09:28:48.865597 |
Rating | 4435 |
Matches played | 5101 |
Win rate | 40.4 |
Use rpsrunner.py to play unranked matches on your computer.
import random
moves = {'R': 'P', 'P': 'S', 'S': 'R'}
if not input:
history = ''
history += input
if len(history) < 25:
output = random.choice(moves.keys())
else:
possible = [moves[i] for i in history[:25]]
output = random.choice(possible)