pouret

Authorpouet
Submission date2020-01-23 16:28:19.656605
Rating1967
Matches played202
Win rate20.79

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

Source code:

#!/usr/bin/env python

import random

if input == "":
    round = 0
    rand = random.randint(7, 11)
    r = p = s = 0
    last_move = "R"
elif input == "R":
    r += 1
    if last_move == "S":
        p /= 2
elif input == "P":
    p += 1
    if last_move == "R":
        s /= 2
elif input == "S":
    s += 1
    if last_move == "P":
        r /= 2

if round % rand == 0:
    output = "R"
else:
    output = "S"
    if r > s and r > p:
        output = "P"
    elif s > p:
        output = "R"