Forgot to commit
parent
715a4517aa
commit
57e4b8489f
6
chess.py
6
chess.py
|
@ -490,7 +490,6 @@ class Game:
|
|||
the move puts the player in check."""
|
||||
new = deepcopy(self)
|
||||
valid = new.move(source, dest, promotion)
|
||||
new.turn = self.turn
|
||||
return valid, new
|
||||
|
||||
def AN_move(self, move):
|
||||
|
@ -517,8 +516,9 @@ class Game:
|
|||
moves = []
|
||||
for sq in sqrs:
|
||||
valid, new = self.validate_move(sq, dest, promotion)
|
||||
check = new.is_check()==info.check and new.is_mate()==info.mate
|
||||
if valid and check:
|
||||
check = new.is_check()==info.check
|
||||
mate = new.is_mate()==info.mate
|
||||
if valid and (check or mate):
|
||||
moves.append((sq, dest, promotion))
|
||||
if len(moves) != 1:
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue