MCPcopy Index your code
hub / github.com/ndleah/python-mini-project / makeMove

Method makeMove

Chess_Game/ChessEngine.py:23–34  ·  view source on GitHub ↗
(self, move)

Source from the content-addressed store, hash-verified

21 self.staleMate = False
22
23 def makeMove(self, move):
24 self.board[move.startRow][move.startCol] = "--"
25 self.board[move.endRow][move.endCol] = move.pieceMoved
26 self.moveLog.append(move)
27 self.whiteToMove = not self.whiteToMove
28 if move.pieceMoved == "wK":
29 self.whiteKingLocation = (move.endRow, move.endCol)
30 elif move.pieceMoved == "bK":
31 self.blackKingLocation = (move.endRow, move.endCol)
32
33 if move.isPawnPromotion:
34 self.board[move.endRow][move.endCol] = move.pieceMoved[0] + "Q"
35
36
37 def undoMove(self):

Callers 2

mainFunction · 0.95
getValidMovesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected