Historian

Authorvladh
Submission date2011-05-25 22:28:31.852285
Rating3250
Matches played7215
Win rate30.03

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

Source code:

# remembers moved and beats the most frequent
# -vladh
import random;

def beat(move):
	if move=="R": return "P";
	if move=="P": return "S";
	if move=="S": return "R";
	return None;
def numToMove(num):
	if num==0: return "R";
	if num==1: return "P";
	if num==2: return "S";
	return None;

if input=="":
	history="";
else:
	history+=input;

f=[0,0,0];
for i in history:
	if i=="R": f[0]+=1;
	if i=="P": f[1]+=1;
	if i=="S": f[2]+=1;
	
output=beat(numToMove(f.index(max(f))));