Author | hoosierfan24 |
Submission date | 2014-04-28 01:16:16.014937 |
Rating | 6305 |
Matches played | 608 |
Win rate | 60.53 |
Use rpsrunner.py to play unranked matches on your computer.
import random
winners = {'P': 'S', 'R': 'P', 'S': 'R'}
if input == '':
i = 0
myMoves = ''
moves= []
output = 'R'
else:
i += 1
myMoves += output
moves += i*list(input)
moves += i*list(winners[output])
theirMove = random.choice(moves)
output = winners[theirMove]