Author | nk! |
Submission date | 2017-12-08 18:08:32.583180 |
Rating | 5060 |
Matches played | 305 |
Win rate | 51.48 |
Use rpsrunner.py to play unranked matches on your computer.
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 opponentMoves[0:-4]:
opponentMoves.index(L)
return opponentMoves[opponentMoves.index + len(L)]
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"])