Author | slowderp |
Submission date | 2011-06-12 10:27:19.383546 |
Rating | 6019 |
Matches played | 5453 |
Win rate | 61.16 |
Use rpsrunner.py to play unranked matches on your computer.
from random import randint
beat = {'R':'P', 'P':'S', 'S':'R'}
if input in beat.keys():
opmoves.append(input)
mymoves.append(beat[beat[mymoves[randint(0, len(mymoves)-1)]]] if randint(0, 2) else beat[opmoves[randint(0, len(opmoves)-1)]])
else:
opmoves = []
mymoves = [beat.keys()[randint(0, 2)]]
output = mymoves[-1]