Author | Colin Rice |
Submission date | 2012-11-20 22:05:00.516552 |
Rating | 4227 |
Matches played | 802 |
Win rate | 43.89 |
Use rpsrunner.py to play unranked matches on your computer.
import random
def next(entry):
a = ['R', 'P', 'S']
index = a.index(entry)
index = index+1
if index > 2:
index = 0
return a[index]
if input=="":
output = random.choice(['R', 'P', 'S'])
their_moves = []
else:
their_moves.append(input)
choice = random.choice(input)
output = next(choice)