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

Method getAllPossibleMoves

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

Source from the content-addressed store, hash-verified

89 All move without considering checks
90 """
91 def getAllPossibleMoves(self):
92 moves = []
93 for r in range(len(self.board)):
94 for c in range(len(self.board[r])):
95 turn = self.board[r][c][0] # b or w based on turn
96 if(turn == 'w' and self.whiteToMove) or (turn == 'b' and not self.whiteToMove):
97 piece = self.board[r][c][1]
98 self.moveFunctions[piece](r,c, moves)
99 return moves
100
101
102 def getPawnMoves(self, r, c, moves):

Callers 2

getValidMovesMethod · 0.95
squareUnderAttackMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected