.
This commit is contained in:
parent
ea6043e7ac
commit
861fa8c9b4
Binary file not shown.
4
main.py
4
main.py
@ -6,9 +6,9 @@ game.printBoard()
|
||||
game2.printBoard()
|
||||
ruch = None
|
||||
while True:
|
||||
time.sleep(1)
|
||||
#time.sleep(1)
|
||||
ruch = game.nextMove(ruch)
|
||||
game.printBoard()
|
||||
time.sleep(1)
|
||||
#time.sleep(1)
|
||||
ruch = game2.nextMove(ruch)
|
||||
game2.printBoard()
|
5
move.py
5
move.py
@ -27,7 +27,7 @@ class Move:
|
||||
self.initial_row, self.initial_column, self.final_row, self.final_column = Move.random_valid_move(self, color)
|
||||
self.x=self.board.boardlist[self.initial_row][self.initial_column].piece
|
||||
self.board.boardlist[self.initial_row][self.initial_column].piece = None
|
||||
Move.mat(self, self.x, self.final_row, self.final_column)
|
||||
Move.mat(self, self.final_row, self.final_column)
|
||||
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
||||
Move.pawn_promotion(self, self.x, self.final_row)
|
||||
# update piece
|
||||
@ -99,9 +99,10 @@ class Move:
|
||||
if x.name == "pawn":
|
||||
if (final_row == 0) or (final_row == 7):
|
||||
x.name = "queen"
|
||||
def mat(self, x, final_row, final_column):
|
||||
def mat(self, final_row, final_column):
|
||||
if self.board.boardlist[final_row][final_column].has_piece():
|
||||
if self.board.boardlist[final_row][final_column].piece.name == 'king':
|
||||
print("mat")
|
||||
exit(0)
|
||||
pass
|
||||
def check_szach(self, color, initial_row, initial_column, final_row, final_column):
|
||||
|
Loading…
Reference in New Issue
Block a user