Win_Stay

AuthorJustinF
Submission date2011-06-15 03:59:26.452934
Rating5053
Matches played5227
Win rate45.49

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

Source code:

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