mvsS1

AuthorMarco
Submission date2019-02-05 20:42:06.426991
Rating1607
Matches played250
Win rate14.8

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

Source code:

import random
class RPS:
    previousOut = "R"
    previousWin = "R"

def calculateWin(x,y):
    if x == y:
        return "D"

    if x == "R" and y == "S" :
        return "L"
    if x == "S" and y == "P" :
        return "L"
    if x == "P" and y == "R" :
        return "L"

    if y == "R" and x == "S" :
        return "W"
    if y == "S" and x == "P" :
        return "W"
    if y == "P" and x == "R" :
        return "W"


if input == "" :
    RPS.previousOut = random.choice(["R","P","S"])
    output = RPS.previousWin
    
else:
    RPS.previousOut = "R"
    output = RPS.previousOut