pawn promotion
This commit is contained in:
parent
73bef9f806
commit
1fcc420ae7
Binary file not shown.
Binary file not shown.
4
board.py
4
board.py
@ -201,6 +201,10 @@ class Board:
|
|||||||
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
||||||
exit(0)
|
exit(0)
|
||||||
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
||||||
|
#pawn promotion
|
||||||
|
if isinstance(self.x, Pawn):
|
||||||
|
if (self.final_row==0) or (self.final_row==7):
|
||||||
|
self.board.boardlist[self.final_row][self.final_column].piece = Queen(self.x.color)
|
||||||
self.board.boardlist[self.final_row][self.final_column].piece.moved = True
|
self.board.boardlist[self.final_row][self.final_column].piece.moved = True
|
||||||
self.board.boardlist[self.final_row][self.final_column].piece.delete_moves()
|
self.board.boardlist[self.final_row][self.final_column].piece.delete_moves()
|
||||||
|
|
||||||
|
1
game.py
1
game.py
@ -116,6 +116,7 @@ class Game:
|
|||||||
self.to_column = 6
|
self.to_column = 6
|
||||||
elif self.to_column == 'H':
|
elif self.to_column == 'H':
|
||||||
self.to_column = 7
|
self.to_column = 7
|
||||||
|
|
||||||
self.color = Board.move_rival(self, self.from_row, self.from_column, self.to_row, self.to_column)
|
self.color = Board.move_rival(self, self.from_row, self.from_column, self.to_row, self.to_column)
|
||||||
return Board.move_boot(self, self.color)
|
return Board.move_boot(self, self.color)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user