r300_reverse

Authorrand0m
Submission date2019-11-24 20:27:34.765865
Rating5381
Matches played79
Win rate55.7

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

Source code:

import random

if input == "":
    ycards = {"R": 0, "P": 0, "S": 0}
    count = 0
else:
    ycards[input] += 1
    count += 1

if count <= 300:
    output = random.choice(["R", "P", "S"])

rs = ycards["R"]
ps = ycards["P"]
ss = ycards["S"]

rint = random.randint(0, count)
if rint < rs:
    output = "P"
elif rint < (rs + ps):
    output = "S"
else:
    output = "R"