I am using a single-dimensional array to simulate a two-dimensional array, due to the performance increase of doing so.
The formular for finding the index of where to place the item is the following, when the height of the array is 30 items, and the width of the array is 20 items.
offset = x * 30 + y
Given this same information, how would I convert an offset back into positions? I know it’s possible. I just can’t think of how to do it.
1 Answer