uint64_t func() { // we have 8*8 board and 12 pieces // (6 for white side and 6 for black) // filled with random values uint64_t table[12][8][8]; // for each square on board. 0 - no piece. 1..12 - piece int position[8][8]; uint64_t hash; for (int row=0; row<8; row++) for (int col=0; col<8; col++) { int piece=position[row][col]; if (piece!=0) hash=hash^table[piece][row][col]; }; return hash; } /* vi: set sw=4 ts=4: */