so, here's the problem:
the numbers are arranged in how the tile's are layed out in memory, however, i want to be able to get a patch of tile's relative to how the white lines are layed out.
for example: column 1 is 6, 9, and 13. 2 is 3, 7, and 10, and 3 is 1, 4, and 8.
so my input would be something like this: the bottom tile's index in the world(in this case that is tile #6), and then i'd specify which tile i was last on, and finally i'd pass the column and row size to get the chunk of.
the goal is to quickly determine which column/row the last tile is on, increment first by column, then by row. so i'd iterate over tiles 6, 9, 13, 3, 7, 10, 1, 4, and 8.
i'm having trouble creating an algorithm which can extract the row/column from the index of the tile(and do the reverse).
edit: after a bit more analysis, i figured out an algorithm to suit my needs.
edit2: ok, i can get the column/row, and thought i could figure out how to get back easily. But i can't seem to figure out how to get back to the index.
This is what i'm doing to get the column/row:
//above example, the width and height can be taken as 3, and 5.
//note all divisions are integers, and round down.
void Get(int Index){
int x = Index%width;
int y = Index/width;
int column = x+(height/2-((height&1)^1))-(y/2);
int row = x+(y+1)/2;
}