Skip to content

Commit

Permalink
fix: fixed last move to be lit up while board diff is being shown
Browse files Browse the repository at this point in the history
small fix
  • Loading branch information
nicvagn committed Aug 7, 2024
1 parent 0f39a72 commit a0ae964
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions nicsoft/niclink/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,20 +684,20 @@ def show_board_diff(self, board1: chess.Board, board2: chess.Board) -> bool:
py_square
) or self.square_in_last_move(square):
# record the diff in diff array, while keeping the last move lit up
self.logger.info(
"man.show_board_diff(...): Diff found at square %s", square
)
# do not record diff's on the move squares, but light them up
if not self.square_in_last_move(square):
diff = True
# add square to list off diff squares
diff_cords = square_cords(square)
diff_squares.append(square)

diff_map[diff_cords[1]] = (
zeros[: diff_cords[0]] + "1" + zeros[diff_cords[0] :]
self.logger.info(
"man.show_board_diff(...): Diff found at square %s", square
)

# add square to list off diff squares
diff_cords = square_cords(square)
diff_squares.append(square)

diff_map[diff_cords[1]] = (
zeros[: diff_cords[0]] + "1" + zeros[diff_cords[0] :]
)

if diff:
# set all the led's that differ
self.set_all_LEDs(diff_map)
Expand Down

0 comments on commit a0ae964

Please sign in to comment.