Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chess_app/chess_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down