LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

any algorithm to convert integer position to incremental unsigned int

Root / Programming Questions / [.]

raimondzCreated:
Hi. I'm working on a chunk system for the background but I have troubles with the reference of each chunk. Each chunk has a coordinate (x,y) with integer values but I want to associate them with an unique positive integer id because i want to use an unidimensional array and COPY to get the data of the map by it offset I made math expression(can't write it right now because I 'm writing with a phone) but it skip some numbers. I want it to generate contiguous id but i can't figure out how could I do it without lowering the performance.