Author | JustinF |
Submission date | 2011-06-15 03:59:26.452934 |
Rating | 5053 |
Matches played | 5227 |
Win rate | 45.49 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == '':
output = 'P'
else:
if not ((output == 'P' and input == 'R') or (output == 'S' and input == 'P') or (output == 'R' and input == 'S')):
if (output == 'R'):
output = random.choice(('P', 'S'))
elif (output == 'P'):
output = random.choice(('R', 'S'))
else:
output = random.choice(('R', 'P'))