def hash(self, board, colour): h = 0 if colour == 'black': h = h ^ self.black_move p = 0 for i in range(128): if (i & 0x88) == 0: if board.board[i] != None: j = self.constVal[self.pieceChar.index(board.board[i].character)] h = h ^ self.table[p][j] p += 1 return h