From 7a37335a310b13d61c45c0ecdfd95461b4ba75b7 Mon Sep 17 00:00:00 2001 From: Nate Solon Date: Wed, 15 Jan 2025 17:01:22 -0800 Subject: [PATCH] board fixes --- chess_app/chess_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: