bait and switch

Authorhawk
Submission date2011-06-09 09:55:25.294147
Rating2357
Matches played5402
Win rate22.84

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

Source code:

import random
change = { "RR": 0, "RP": -1, "RS": 1, "PR": 1, "PP": 0, "PS": -1, "SR": -1, "SP": 1, "SS": 0 }

if input == "":
   played = 0
   delta = 0
else:
   delta += change[last + input]

if delta < 10:
   if played < 200:
       output = "S"
   else:
       output = "P"
else:
   output = random.choice(["R", "P", "S"])

played += 1
last = output