Skip to content

Commit e361036

Browse files
committed
fixed rook not moving fix
1 parent 8e8e38a commit e361036

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/boardlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def receive_coords(self, x, y):
8989
def draw_square(self, x, y):
9090
"""Draws the square at the position"""
9191
coords = self.get_coords(x, y)
92-
self.piece_at[coords] = None
92+
# self.piece_at[(x, y)] = None
9393

9494
if (x+y) % 2:
9595
self.screen.blit(self.dark, coords)

lib/movelib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def draw_piece(self, piece, position):
1616
else:
1717
self.draw_square(*position)
1818
self.screen.blit(self.piece_to_img[piece], self.get_coords(*position))
19+
assert all(0 <= val <= 7 for val in position), str(position)
1920
self.piece_at[position] = piece
2021

2122

@@ -28,6 +29,7 @@ def draw_move(self, beg, end):
2829
:return: None
2930
"""
3031
piece = self.piece_at.get(beg, None)
32+
assert piece is not None, f"{self.piece_at} doesn't have\n\n{beg}"
3133
if \
3234
piece in 'pP' \
3335
and ((end[1] == 0 and self.board.turn) \

0 commit comments

Comments
 (0)