Author | Simon Hooker / Aeiedil |
Submission date | 2011-06-18 10:36:11.118534 |
Rating | 3525 |
Matches played | 5105 |
Win rate | 32.38 |
Use rpsrunner.py to play unranked matches on your computer.
# Strayegg Hobo
# Simon Hooker / Aeiedil (simon@strayegg.com)
# The hobo is a simple beast that just takes a guess based on no good logic at alll, hooray
# config if match start
import random
if not input:
# new batch
ursum = 0
mysum = 0
validoptions = ["S","P","R"]
# choose a random
output=random.choice(validoptions)
else:
# input will be R P or S
# add to sums and mod
for index,item in enumerate(validoptions):
if item==input:
ursum = (ursum+index)%3
if item==output:
mysum = (mysum+index)%3
output = validoptions[(ursum+mysum)%3]