Hmm, ok, thanks. I'll make sure to do that. And thanks for the link, I'll check that out too!pedrojdm2021 wrote: ↑Fri Jun 18, 2021 5:22 am In transpositions you need to consider:
- Side to move
- Piece placement
- En passant (if any)
- Castling rights (if any)
Each time you make a move in your board you need to update your transposition hash using the same xorbist techique that you use for generating it from scratch
for example when you move a piece:Code: Select all
board_hash ^= zorbistKeys.Pieces[PieceColour][SquareFrom][SquareTo];
To test it go grab some fen, you can use the "tricky" position, from the "perft" results in chess programming wiki.
grab the initial board hash and print it into the console.
make your move, print the updated hash, it should change.
then grab a fen that corresponds with the move that you have made, and build the tranposition hash from scratch.
compare the hash made from scratch with the hash that you updated in your make_move function. both must be equal. if they are different you are doing something wrong. Once you got it Ok. repeat the process for each type of move: moves,captures, castling, en-passant, do that for both players.
when you get it correct for all tests, your board hashing must be ok. if you get it correct in the hashing BUT you still having issues, probably is something wrong during the implementation itself.
you can check out this article on transpositions to get a more clear idea inside the implementation during the search:
https://web.archive.org/web/20070206185 ... ashing.htm
Problems with my transposition table implementation?
Moderator: Ras
-
algerbrex
- Posts: 608
- Joined: Sun May 30, 2021 5:03 am
- Location: United States
- Full name: Christian Dean