MCPcopy
hub / github.com/ndleah/python-mini-project / undoMove

Method undoMove

Chess_Game/ChessEngine.py:37–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35
36
37 def undoMove(self):
38 if len(self.moveLog) != 0:
39 move = self.moveLog.pop()
40 self.board[move.startRow][move.startCol] = move.pieceMoved
41 self.board[move.endRow][move.endCol] = move.pieceCaptured
42 self.whiteToMove = not self.whiteToMove
43 if move.pieceMoved == "wK":
44 self.whiteKingLocation = (move.startRow, move.startCol)
45 if move.pieceMoved == "bK":
46 self.blackKingLocation = (move.startRow, move.startCol)
47 """
48 All move considering checks
49 """

Callers 2

mainFunction · 0.95
getValidMovesMethod · 0.95

Calls 1

popMethod · 0.45

Tested by

no test coverage detected