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

Method inCheck

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

Source from the content-addressed store, hash-verified

68 return moves
69
70 def inCheck(self):
71 if self.whiteToMove:
72 return self.squareUnderAttack(self.whiteKingLocation[0], self.whiteKingLocation[1])
73 else:
74 return self.squareUnderAttack(self.blackKingLocation[0], self.blackKingLocation[1])
75
76 def squareUnderAttack(self, r, c):
77 self.whiteToMove = not self.whiteToMove

Callers 1

getValidMovesMethod · 0.95

Calls 1

squareUnderAttackMethod · 0.95

Tested by

no test coverage detected