heh
eheunknown
actionscript
3 years ago
1.3 kB
13
Indexable
class Piece:
def __init__(self, color):
self.color = color
class Pawn(Piece):
def __init__(self, color):
super().__init__(color)
class Knight(Piece):
def __init__(self, color):
super().__init__(color)
class Bishop(Piece):
def __init__(self, color):
super().__init__(color)
class Rook(Piece):
def __init__(self, color):
super().__init__(color)
class Queen(Piece):
def __init__(self, color):
super().__init__(color)
class King(Piece):
def __init__(self, color):
super().__init__(color)
class Board:
def __init__(self):
self.board = [[None for _ in range(8)] for _ in range(8)]
self.populate()
def populate(self):
# Populate the board with pieces
pass
def move(self, start, end):
# Move a piece from start to end
pass
def is_valid(self, start, end):
# Check if the move is valid
pass
def print(self):
# Print the board
pass
class Game:
def __init__(self):
self.board = Board()
def play(self):
# Play the game
pass
if __name__ == "__main__":
game = Game()
game.play()
Editor is loading...