News for hackers. Stuff that matters.
Re:Magic Bitboards: Finding all valid bishop moves in a 64-b... by cglouch on Tuesday April 17, 2018 @02:44PM (#16861120)
Using bit manipulation to calculate chess piece movements is really quite satisfying. If magic bitboards are too confusing, the precursor - "kindergarten bitboards" - are a bit easier to understand. I have a description here if anyone is curious: https://github.com/cglouch/snakefish#sliding-pieces

I think once you understand the principle behind kindergarten bitboards, magic bitboards start to make more sense. It's basically a more clever way of indexing into a precomputed move table, that takes advantage of the redundancy in occupancy states, and requires even fewer instructions to determine the index. Although it does still feel kinda magic!

There are no comments on this comment yet.