Author | RANDOM_=D |
Submission date | 2011-05-21 22:43:51.565237 |
Rating | 4943 |
Matches played | 7442 |
Win rate | 48.93 |
Use rpsrunner.py to play unranked matches on your computer.
import math
import random
r = random.randrange(0,2)
if r==0 or r==1:
move = random.randrange(0,3)
if move == 1:
output = "R"
elif move == 2:
output = "P"
else:
output = "S"
elif r==2:
if not input:
output = 'P'
else:
output = {'R':'P', 'P':'S', 'S':'R'}[input]