diff --git a/chess_app/chess_app.py b/chess_app/chess_app.py index 9c1d154..fd649b1 100644 --- a/chess_app/chess_app.py +++ b/chess_app/chess_app.py @@ -65,11 +65,11 @@ async def on_disconnect(self, websocket, close_code): COLS = 'abcdefgh' def Board(lmoves: list[str] = [], selected: str = ''): board = [] - for row in ROWS: + for col in COLS: board_row = [] - for col in COLS: + for row in ROWS: pos = f"{col}{row}" - cell_color = "black" if (ROWS.index(row) + COLS.index(col)) % 2 == 0 else "white" + cell_color = "white" if (ROWS.index(row) + COLS.index(col)) % 2 == 0 else "black" cell_color = 'active' if pos in lmoves else cell_color cell_cls = f'board-cell {cell_color}' if pos == selected: