Как разместить плату сброса в CSV-файле? Это значительно улучшит читабельность вашего кода и упростит его обслуживание
def resetBoard(self): # Initializw Black Pieces # self.board[0][0] = Spot(0,0,piece) # black rooks self.board[0][1] = Spot(0, 1, piece) # black knight # self.board[0][2] = Spot(0,2,piece) # black bishops # self.board[0][3] = Spot(0,3,piece) # black queens self.board[0][4] = Spot(0, 4, piece) # black king # self.board[0][5] = Spot(0,5,piece) # black bishops self.board[0][6] = Spot(0, 6, piece) # black knight # self.board[0][7] = Spot(0,7,piece) # black rooks self.board[1][0] = Spot(1, 0, piece) # black pawn self.board[1][1] = Spot(1, 1, piece) # black pawn self.board[1][2] = Spot(1, 2, piece) # black pawn self.board[1][3] = Spot(1, 3, piece) # black pawn self.board[1][4] = Spot(1, 4, piece) # black pawn self.board[1][5] = Spot(1, 5, piece) # black pawn self.board[1][6] = Spot(1, 6, piece) # black pawn self.board[1][7] = Spot(1, 7, piece) # black pawn # Initializw White Pieces self.board[6][0] = Spot(6, 0, piece) # white pawn self.board[6][1] = Spot(6, 1, piece) # white pawn self.board[6][2] = Spot(6, 2, piece) # white pawn self.board[6][3] = Spot(6, 3, piece) # white pawn self.board[6][4] = Spot(6, 4, piece) # white pawn self.board[6][5] = Spot(6, 5, piece) # white pawn self.board[6][6] = Spot(6, 6, piece) # white pawn self.board[6][7] = Spot(6, 7, piece) # white pawn # self.board[7][0] = Spot(7,0,piece) # white rooks self.board[7][1] = Spot(7, 1, piece) # white knight # self.board[7][2] = Spot(7,2,piece) # white bishops # self.board[7][3] = Spot(7,3,piece) # white queens self.board[7][4] = Spot(7, 4, piece) # white king # self.board[7][5] = Spot(7,5,piece) # white bishops self.board[7][6] = Spot(7, 6, piece) # white knight # self.board[7][7] = Spot(7,7,piece) # white rooks
Что я уже пробовал:
Я пробовал использовать примеры в интернете