Tell us what’s happening:
Need help. Keep getting stuck on Tests 11, 12, and 13.
Your code so far
from abc import ABC, abstractmethod
from random import choice
class Player(ABC):
def __init__(self) -> None:
self.moves = []
self.position = (0, 0)
self.path = [self.position]
def make_move(self) -> tuple:
import random
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) -> None:
pass
class Pawn(Player):
def __init__(self) -> None:
super().__init__()
self.moves = [(0, 1), (0, -1), (1, 0), (-1, 0)]
def level_up(self) -> None:
self.moves += [(1, 1), (1, -1), (-1, -1), (-1, 1)]
pawn = Pawn()
pawn.make_move()
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36
Challenge Information:
Build a Player Interface - Build a Player Interface