# [[SPOILER?]] [ML COURSE] 'RPS' Bot Abbey not working

Hello, I recently started my ML with python course and been learning a lot of awesome stuff. I’ve been trying to code a solution for my player for the RockPaperScissors game, and encountered a bug with the bot Abbey while testing my code.
Here’s what the error looked like :

My code seems like working against Quincy. Do i need to ajust something in the Abbey’s code?
Here’s my full code btw, I’m predicting the next move of the opponent based on what he played next to his every moves.
(spoiler here maybe)

def player(prev_play, opponent_history=):
opponent_history.append(prev_play)
guess = “R”
nb_coups = len(opponent_history)

``````if nb_coups == 0:
guess = "R"

else:

L=[0,0,0,0,0,0,0,0,0]

for k in range(nb_coups-1):
if opponent_history[k] == "R":
if opponent_history[k+1] == "R":
L[0]+=1
if opponent_history[k+1] == "P":
L[1]+=1
if opponent_history[k+1] == "S":
L[2]+=1
if opponent_history[k] == "P":
if opponent_history[k+1] == "R":
L[3]+=1
if opponent_history[k+1] == "P":
L[4]+=1
if opponent_history[k+1] == "S":
L[5]+=1
if opponent_history[k] == "S":
if opponent_history[k+1] == "R":
L[6]+=1
if opponent_history[k+1] == "P":
L[7]+=1
if opponent_history[k+1] == "S":
L[8]+=1

C=["P","¨S","R"]

if prev_play == "R":
M=[L[0],L[1],L[2]]
guess = C[M.index(max(M))]
if prev_play == "P":
M=[L[3],L[4],L[5]]
guess = C[M.index(max(M))]
if prev_play == "S":
M=[L[6],L[7],L[8]]
guess = C[M.index(max(M))]

return guess
``````

Note the funny quotation of `"S"`. The error indicates abbey, but I think it should be failing in the first conditional of the loop in `play()`. While debugging, it fails the first time your player plays `S` at that point.