Author | RyanC |
Submission date | 2012-10-03 22:16:29.829585 |
Rating | 3348 |
Matches played | 783 |
Win rate | 30.78 |
Use rpsrunner.py to play unranked matches on your computer.
from hashlib import sha256
state = ''
throws = ['R', 'P', 'S']
if input:
state = state + input
output = throws[int(sha256(state).hexdigest(), 16) % len(throws)]