4 ms·
A bit OT, but I recall being surprised to read somewhere that some chess engines do the very same thing. That is, if one pictures the board as a 64bit bitmask,
by fenomas 11y ago
A bit OT, but I recall being surprised to read somewhere that some chess engines do the very same thing.
That is, if one pictures the board as a 64bit bitmask, one can store masks for the locations of each side's pieces, as well as masks for the legal moves of each piece type when in each position. Then tasks like determining if a move is legal can be done with ANDs and so on.
- Galanwe 11y agoThese are called bitboards: https://chessprogramming.wikispaces.com/Bitboards https://chessprogramming.wikispaces.com/Bitboards