Checkers Bitboard representation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

universecoder
Posts: 53
Joined: Mon Sep 19, 2016 6:51 am

Re: Checkers Bitboard representation

Post by universecoder »

In my case, what would be an efficient way to detect out-of-board moves?
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: Checkers Bitboard representation

Post by Rein Halbersma »

phhnguyen wrote:I did not work with checker but Xiangqi (the board size is 90). From my recent experience:
- uint64_t usually is the best for speed. But the gain depends much on the way you optimise the code, and just about 2-5% faster, compared with uint32_t
- if you organise bitboard well, you can easily convert (cast) data structure from uint64_t to uint32_t and vice versa whenever you want. That make the difference between representations become so little

IMO, if your data with uint32_t-representation is significantly smaller than one with uint64_t, go with uint32_t. Otherwise go with uint64_t for having easier life
For Xiangqi, have you tried __uint128_t (gcc/clang extension)? For large checkerboards (in Canada, they play on 12x12 boards with 72 squares) it gave a small but measurable speedup compared to 2x64 or 3x32.