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