dalek test 1

Authornk!
Submission date2017-12-06 16:50:11.996850
Rating5067
Matches played318
Win rate54.09

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

Source code:

import random

opponentMoves=[]
output=random.choice(["R","P","S"])
if input == "":
    opponentMoves = []
elif input == "R":
    opponentMoves += "R"
elif input == "P":
    opponentMoves += "P"
elif input == "S":
    opponentMoves += "S"

def analyzeList(opponentMoves, L):
    L = opponentMoves[:-4]
    if L == "":
        output = random.choice(["R","P","S"])
    elif L in opponentMoves[0:4]:
        if L[0]== "R":
            output= "P"
        elif L[0]== "P":
            output= "S"
        elif L[0]== "S":
            output= "R"
    elif L not in opponentMoves[4:]:
        return analyzeList(opponentMoves[1:], L[1:])

if len(opponentMoves)>10:
    analyzeList(opponentMoves, L)