Smartie

AuthorJorge
Submission date2011-07-06 18:25:05.238488
Rating3780
Matches played4502
Win rate36.18

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

Source code:

import random

if input == "":
	plays = {"R": [],
			 "P": [],
			 "S": []}
	beats = {"R": "S","P": "R","S": "P"}
	output = random.choice(["R","P","S"])
else:
	plays[mylast].append(input)
	try:
		output = random.choice(plays[mylast])
	except IndexError:
		output = random.choice(["R","P","S"])

mylast = output