rps_v1

Authortac
Submission date2014-12-06 15:34:35.133502
Rating5767
Matches played523
Win rate59.85

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

Source code:

import random

beat = {'R':'P', 'P':'S', 'S':'R'}


output = random.choice(["R","P","S"])

if input == "":
	h = ""
else:
	h += input
	
	if len(h) >= 20:
		if len(h) <= 100 and h[-5:] in ['RRRRR', 'PPPPP', 'SSSSS']:
			output = beat[h[-1]]
		elif len(h) <= 300 and h[-6:] in ['RRRRRR', 'PPPPPP', 'SSSSSS']:
			output = beat[h[-1]]
		elif h[-3:] == h[-6:-3] == h[-9:-6]:
			output = beat[h[-3]]