SHA256-Prime

AuthorRyanC
Submission date2012-10-04 01:34:39.822462
Rating4597
Matches played762
Win rate47.38

Use rpsrunner.py to play unranked matches on your computer.

Source code:

from hashlib import sha256

throws = ['R', 'P', 'S']
beat_throw = { 'R' : 'P', 'P' : 'S', 'S' : 'R' }

# This claim isn't true for SHA256-Prime :-(
if input == '':
    state = 'I win against bots that always throw the same thing!'
else:
    state = state + output

sha256_output = throws[int(sha256(state).hexdigest(), 16) % len(throws)]

# Output throw that beats SHA256
output = beat_throw[sha256_output]