dalek test 2

Authornk!
Submission date2017-12-06 16:55:45.456910
Rating4836
Matches played324
Win rate44.75

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

Source code:

import random

opponentMoves=[]
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)<=9:
    output=random.choice(["R","P","S"])
else:
    analyzeList(opponentMoves, L)