Tell us what’s happening:
can someone tell me what is wrong on my code why i can’t pass test 11, 12 , 13 , 23 and 25 . i think my code is written correctly an i dont understand what is wrong on my code.
Your code so far
from abc import ABC, abstractmethod
import random
class Player(ABC):
"""abstract class defining the player"""
def __init__(self):
self.moves = []
self.position = (0, 0)
self.path = [self.position]
@abstractmethod
def make_move(self):
move = random.choice(self.moves)
new_position = (
self.position[0] + move[0],
self.position[1] + move[1]
)
self.position = new_position
self.path.append(self.position)
return self.position
@abstractmethod
def level_up(self):
pass
class Pawn(Player):
def __init__(self):
super().__init__()
self.moves= [(1, 0), (-1, 0), (0, 1), (0, -1)]
def level_up(self):
new_moves = [(1,1), (1,-1),(-1,1),(-1,-1)]
self.moves +=new_moves
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Build a Player Interface - Build a Player Interface