#include "zobrist.h" // =================================================================== // Globals // =================================================================== static uint64_t *zobrist; // =================================================================== // Helpers // =================================================================== // =================================================================== // Exported method implementations // =================================================================== int zobrist_init(void) { if (zobrist != NULL) return EXIT_FAILURE; zobrist = malloc(sizeof(uint64_t)*board_size*board_size*(15*2*3)); for (int k=0; k>= 1) hash ^= zobrist[l*(15*2*3)+h*2*3+(c&1)*3+s]; } return hash; }