Author | ntsp |
Submission date | 2011-06-09 08:27:25.546337 |
Rating | 2232 |
Matches played | 5420 |
Win rate | 20.09 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "": # initialize variables for the first round
moves = []
beat = "R"
else:
moves.append(input)
random.shuffle(moves)
if beat == "R":
output = "P"
elif beat == "P":
output = "S"
else:
output = "R"