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

Method squareUnderAttack

Chess_Game/ChessEngine.py:76–83  ·  view source on GitHub ↗
(self, r, c)

Source from the content-addressed store, hash-verified

74 return self.squareUnderAttack(self.blackKingLocation[0], self.blackKingLocation[1])
75
76 def squareUnderAttack(self, r, c):
77 self.whiteToMove = not self.whiteToMove
78 oppMoves = self.getAllPossibleMoves()
79 self.whiteToMove = not self.whiteToMove
80 for move in oppMoves:
81 if move.endRow == r and move.endCol == c:
82 return True
83 return False
84
85
86

Callers 1

inCheckMethod · 0.95

Calls 1

getAllPossibleMovesMethod · 0.95

Tested by

no test coverage detected