Guest User

Untitled

a guest
Sep 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // get the x coordinate for bit set on the board.
  2. // b must have exactly 1 bit set or else the behavior is undefined.
  3. uint getX() {
  4. static uint x_precomputed[67] =
  5. {
  6. 0, 7, 6, 0, 5, 0, 7, 0,
  7. 4, 3, 7, 4, 6, 4, 7, 1,
  8. 3, 0, 2, 5, 6, 1, 3, 3,
  9. 5, 1, 3, 4, 6, 3, 0, 0,
  10. 2, 7, 0, 1, 1, 1, 4, 5,
  11. 5, 2, 0, 6, 2, 4, 2, 5,
  12. 4, 1, 0, 2, 2, 6, 3, 7,
  13. 5, 6, 2, 3, 7, 0, 7, 4,
  14. 1, 5, 6
  15. };
  16.  
  17. return x_precomputed[board % 67];
  18. }
Add Comment
Please, Sign In to add comment