4 ms·
Ah, brings back memories of chess programming where this stuff was discussed often. See [1] for more of this. I always found Kogge Stone [2] pretty cool, a kind
by halfcat 3y ago
Ah, brings back memories of chess programming where this stuff was discussed often. See [1] for more of this. I always found Kogge Stone [2] pretty cool, a kind of bit-twiddling flood-fill.
[1] https://www.chessprogramming.org/Bit-Twiddling https://www.chessprogramming.org/Bit-Twiddling
[2] https://www.chessprogramming.org/Kogge-Stone_Algorithm https://www.chessprogramming.org/Kogge-Stone_Algorithm
- vjerancrnjak 3y agon-queens too, a simple example that can benefit from this bit trick. Eventually you're looking for free columns in the current row where queen can be put. Instead of going over all columns, with a few bit operations iteration can only go directly through free columns.