tag:blogger.com,1999:blog-7925476.post7981751714079525385..comments2023-08-24T05:15:33.037-05:00Comments on the johnnyGizmo Blog: XNA Sidebar - Converting a single index into multipleAnonymoushttp://www.blogger.com/profile/07175170793950985973noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7925476.post-38553469698322333472009-01-31T15:09:00.000-06:002009-01-31T15:09:00.000-06:00This works for Wid x Wid grid, but stops working w...This works for Wid x Wid grid, but stops working when the grid is not "square" (or when its "jagged").<BR/><BR/>Alternate approach #1:<BR/> j<BR/> 0 1 2 3 4<BR/> ====================<BR/> 0|| [0] 1 2 3 4 <BR/>i 1|| [5] 6 7 8 9<BR/> 2|| [10] 11 12 13 14<BR/><BR/>Wid = 5<BR/><BR/>Notice: [0][5][10]~(i*wid)<BR/><BR/>So: (i * wid) + j = k<BR/>(where "k" is archimedes22https://www.blogger.com/profile/03333127442632813994noreply@blogger.com