Say I had three variables (On a 2D-field):
NumSquares,
WindowSize (Both X and Y has this value),
Index
So if, for example, NumSquares were 8, WindowSize 256 and Index was at 64; How would the algorithm to get positional data out of these variables look?
I assume that by “positional data” you mean coordinates on the grid. And index means position of the tile in linearized array calculated with formula
X + width * Y. Then:I’m not sure what language you are working in, so just to be sure: % is modulo, / is in this context integer division.