Lose_Change

AuthorJustinF
Submission date2011-06-15 03:36:17.434918
Rating3932
Matches played5183
Win rate34.88

Use rpsrunner.py to play unranked matches on your computer.

Source code:

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'))