colors={1:'Black', 0:'White' } pieces={0:'Pawn', 1:'Rook', 2:'Knight', 3:'Bishop', 4:'Queen', 5:'King' } class piece: def __init__(self, piecetype=0, color=0): self.type = piecetype self.color = color def piece_movements(board): return(self.squares_i_can_get_to_on_this(board)) class board: def __init__(self, layout=None): if layout != None: self.squares = layout else: self.squares = [[None] * 8] * 8 # an empty board for i in range (8): squares[1][i] = piece() squares[6][i] = piece(color=1) #add extra pieces def move_piece(self,location, desired_place) from_x, from_y = loaction to_x, to_y = desired_place try: self.squares[from_x][from_y].piece_movements(self.squares).indexof(desired_place) except ValueError: raise IllegalMove tmp_pice = self.squares[from_x][from_y] self.squares[to_x][to_y] = tmp_piece self.squares[from_x][from_y] = None