def getMoves(self, board): possibleMoves = getKingMoves(self.pos, board, self.colour, self.moveNo) possibleMoves = removeKingTake(board, self.colour, possibleMoves) allMoves = checkAllMoves(board, self.colour) print(possibleMoves, allMoves) for move in possibleMoves: if move in allMoves: possibleMoves.remove(move) return possibleMoves
def getMoves(self, board): possibleMoves = getKnightMoves(self.pos, board, self.colour) possibleMoves = removeKingTake(board, self.colour, possibleMoves) return possibleMoves
def getMoves(self, board): possibleMoves = getRookMoves(self.pos, board, self.colour) + getBishopMoves( self.pos, board, self.colour) possibleMoves = removeKingTake(board, self.colour, possibleMoves) return possibleMoves
def getMoves(self, board): possibleMoves = getPawnMoves(self.pos, board, self.colour, self.moveNo) possibleMoves = removeKingTake(board, self.colour, possibleMoves) return possibleMoves