crab-paper.py

AuthorTom
Submission date2019-12-09 03:10:23.972191
Rating4492
Matches played210
Win rate47.14

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

Source code:

import zlib
import random



if input == "": # initialize variables for the first round
	history = ""
else:
	history += input

r = len(zlib.compress(input + 'RP',9))
p = len(zlib.compress(input + 'PS',9))
s = len(zlib.compress(input + 'SR',9))
possible=[]
if r == max(r,p,s): possible.append('R')
if p == max(r,p,s): possible.append('P')
if s == max(r,p,s): possible.append('S')
output = random.choice(possible)