Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // get the x coordinate for bit set on the board.
- // b must have exactly 1 bit set or else the behavior is undefined.
- uint getX() {
- static uint x_precomputed[67] =
- {
- 0, 7, 6, 0, 5, 0, 7, 0,
- 4, 3, 7, 4, 6, 4, 7, 1,
- 3, 0, 2, 5, 6, 1, 3, 3,
- 5, 1, 3, 4, 6, 3, 0, 0,
- 2, 7, 0, 1, 1, 1, 4, 5,
- 5, 2, 0, 6, 2, 4, 2, 5,
- 4, 1, 0, 2, 2, 6, 3, 7,
- 5, 6, 2, 3, 7, 0, 7, 4,
- 1, 5, 6
- };
- return x_precomputed[board % 67];
- }
Add Comment
Please, Sign In to add comment