dalek test 3

Authornk!
Submission date2017-12-08 17:51:57.479610
Rating5094
Matches played324
Win rate51.85

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

Source code:

import random

if input == "":
    opponentMoves =[]
elif input == "R":
    opponentMoves += "R"
elif input == "P":
    opponentMoves += "P"
elif input == "S":
    opponentMoves += "S"

def analyzeList(opponentMoves, L):
    if L in enumerate(opponentMoves[0:-4]):
        for i, j in enumerate(opponentMoves[0:-4]):
            if j == L:
                return(L[i+2])
        else:
            return "" 
if len(opponentMoves)<=9:
    output = random.choice(["R","P","S"])
else:
    L = opponentMoves[-4:]
    analyzeList(opponentMoves, L)
    if analyzeList(opponentMoves, L)== "R":
        output= "P"
    if analyzeList(opponentMoves, L)== "P":
        output= "S"
    if analyzeList(opponentMoves, L)== "S":
        output= "R"
    else:
        output= random.choice(["R","P","S"])