zobristTableGet

This commit is contained in:
2024-09-22 14:52:06 +02:00
parent db958dcac1
commit 6c5ef0586f
4 changed files with 79 additions and 3 deletions

View File

@ -54,6 +54,7 @@ struct castle_t {
struct gameState_t {
uint_least64_t *board;
uint_least64_t zobrist;
uint_least8_t *repetitionTable;
bool color; // color to move
struct castle_t canCastle[2];

View File

@ -1,6 +1,23 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <chess/types.h>
struct zobristTableElement {
uint_least64_t hash;
int_least16_t value;
};
struct zobristTable {
struct zobristTableElement *arr;
size_t length;
};
struct zobristTableResult {
bool success;
int_least16_t value;
};
uint_least64_t rand_64();
uint_least64_t zobristPieceI(struct piece_t piece, uint_least8_t field);
uint_least8_t getFile(const uint_least8_t field);