c# - Coordinate calculation problem! -


i using single-dimensional array simulate two-dimensional array, due performance increase of doing so.

the formular finding index of place item following, when height of array 30 items, , width of array 20 items.

offset = x * 30 + y

given same information, how convert offset positions? know it's possible. can't think of how it.

int x = offset / 30; int y = offset % 30; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -