Skip to content

Commit

Permalink
Merge branch 'master' into readme
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau authored Nov 1, 2023
2 parents 4962a6e + ea8d168 commit 7c109a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions pyalapin/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,12 @@ def deepcopy(self, light=True):
else:
copied_material = self.deep_copy_material()

assert len(copied_material["black"]["alive"]["king"]) > 0, "Black king is dead ?"
assert len(copied_material["white"]["alive"]["king"]) > 0, "White king is dead ?"
assert (
len(copied_material["black"]["alive"]["king"]) > 0
), "Black king is dead ?"
assert (
len(copied_material["white"]["alive"]["king"]) > 0
), "White king is dead ?"
copied_object.white_king = copied_material["white"]["alive"]["king"][0]
copied_object.black_king = copied_material["black"]["alive"]["king"][0]
copied_object.all_material = copied_material
Expand Down
16 changes: 12 additions & 4 deletions pyalapin/interface/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,19 @@ def click_cell(self, event):
if game_is_on[0]:
self.update()
(
self.cells[ai_move.start.x][ai_move.start.y].background_normal,
self.cells[ai_move.start.x][ai_move.start.y].background_down,
self.cells[ai_move.start.x][
ai_move.start.y
].background_normal,
self.cells[ai_move.start.x][
ai_move.start.y
].background_down,
) = (
self.cells[ai_move.start.x][ai_move.start.y].background_down,
self.cells[ai_move.start.x][ai_move.start.y].background_normal,
self.cells[ai_move.start.x][
ai_move.start.y
].background_down,
self.cells[ai_move.start.x][
ai_move.start.y
].background_normal,
)
(
self.cells[ai_move.end.x][ai_move.end.y].background_normal,
Expand Down

0 comments on commit 7c109a1

Please sign in to comment.