SPR

AuthorTest
Submission date2019-01-12 00:28:17.372437
Rating3288
Matches played244
Win rate31.56

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

Source code:

import random

if input == "":
	move = {"R": "P", "P": "S", "S": "R"}
	counts = {"R": 0, "P": 0, "S": 0}
	output = random.choice("RPS")
else:
	counts[input] += 1
	max_count = max(counts.values())
	if counts["S"] == max_count:
		pred = "S"
	elif counts["P"] == max_count:
		pred = "P"
	else:
		pred = "R"
	output = "PSR"[["R", "P", "S"].index(pred)]