Mk2

Authoriggi
Submission date2019-02-04 19:57:33.458135
Rating3294
Matches played256
Win rate29.69

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

Source code:

import random

if not input:
    moves = ["R", "P", "S"]
    beatenBy = {"R": "P", "P": "S", "S": "R"}
    
    lPlayed = random.choice(moves)
    output = lPlayed
else:
    lReceived = input
    if lReceived == beatenBy.get(lPlayed, None):
        output = beatenBy.get(lReceived, None)
    else:
        output = lPlayed