This program has been disqualified.
Author | Pawel |
Submission date | 2018-08-21 15:01:31.841840 |
Rating | 5766 |
Matches played | 2 |
Win rate | 100.0 |
import zlib
import random
winning = {"R": "P", "P": "S", "S": "R"}
if not input:
output = random.choice(["R","P","S"])
dna = ""
else:
dna += input
options = []
for move in ["R", "P", "S"]:
options.append((
len(zlib.compress(dna + move))+
len(zlib.compress(dna[-2:] + move)) +
len(zlib.compress(dna[-4:] + move)) +
len(zlib.compress(dna[-8:] + move)) +
len(zlib.compress(dna[-16:] + move)) +
len(zlib.compress(dna[-32:] + move)) +
len(zlib.compress(dna[-64:] + move)) +
len(zlib.compress(dna[-128:] + move)) +
len(zlib.compress(dna[-256:] + move)) +
len(zlib.compress(dna[-512:] + move)) +
len(zlib.compress(dna + move)),
move))
best_opp = min(options)[1]
output = winning[best_opp]