zlib_entropy_v4

This program has been disqualified.


AuthorLogicAI
Submission date2018-08-21 15:55:47.663347
Rating5792
Matches played48
Win rate58.33

Source code:

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 = []
    n = len(dna)
    for move in ["R", "P", "S"]:
        options.append((
            round(len(zlib.compress(dna + move, 9))/10),
        random.random(), move))
    best_opp = min(options)[2]
    output = winning[best_opp]