Strayegg Hobo 2

AuthorSimon Hooker / Aeiedil
Submission date2011-06-18 10:36:11.118534
Rating3525
Matches played5105
Win rate32.38

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

Source code:

# 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]