Inffreqrand

AuthorFreqAuthor
Submission date2019-03-08 02:44:49.855900
Rating7133
Matches played232
Win rate71.98

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

Source code:

from collections import defaultdict
import random
if input == "":
	output = random.choice("RPS")
	hist = output.lower()
else:
	hist += input
        output = random.choice("RPS")
        if random.random() > .9:
		for D in range(min(len(hist)//2, 100) - 1, 0, -1):
                	i = hist[:-2].rfind(hist[-2*D:])
			if i != -1:
				output = "PSR"[["R", "P", "S"].index(hist[i+2*D+1])]
				break
	hist += output.lower()