Common2

Authorntsp
Submission date2011-06-09 08:34:45.397516
Rating5712
Matches played4221
Win rate58.97

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

Source code:

import random

if input == "": # initialize variables for the first round
	moves = []
	beat = "R"
	output = "R"
else:
	moves.append(input)

	random.shuffle(moves)
	beat = moves[0]
	if beat == "R":
		output = "P"
	elif beat == "P":
		output = "S"
	else:
		output = "R"