Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Classic position
- - - - - - - - - 7
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - A
- - - - - - - - -
- - - - - - - - - 0y
- 7 0x
- Linear position
- 0 31
- - - - - - - - - A - - - - - - - - - - - - - - - - - - - - - - -
- ### Position
- cp(A) = classic(position(A)) = (0, 2)
- lp(A) = linear(position(A)) = 8
- ### Equation
- lp(cp(A)) = x(cp(A)) / 2 + y(cp(A)) * (boardSize / 2)
- = (8 / 2) + 2 * (8 / 2)
- = 4 + 2 * 4
- = 8
- cp(lp(A)) = (lp(A) % (boardSize / 2) + 2 * lp(A) / (boardSize / 2) % 2, lp(A) % (boardSize / 2))
- = (8 % 4 + 2 * (8 % 4 % 2), 8 / 4)
- = (0 + 2 * (0 % 2), 2)
- = (0, 2)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement