This is an algorithm that maps a unique positive integer index to every single coordinate pair in all four quadrants using a spiraling pattern similar to an Ulam spiral. Press arrow keys to scroll Press F to enable / disable fast mode Press space to: - enter one number to jump to the coordinates of the entered index. or - enter two numbers separated by one comma ( , ) to jump to the entered coordinates. Why? Because I have plans for a project that procedurally generates the world and if I want to make it infinitely explorable in all four directions I need every index for every coordinate to be a positive integer so I can give each chunk a different number of iterations of the prng I plan to use, and this just happens to be what I came up with. Pros: - Indexes every coordinate pair in all four quadrants - Doesn't need any min or max bounds - Efficient with storage (no huge lookup tables) and project performance (no expensive loops) Cons: - Indexes get pretty big, pretty fast and in extreme cases could overflow the integer limit - No spatial locality, in this map coordinate pairs that are physically right next to each other may not have sequential or predictable indexes Also this is probably the most work I've put in a project in a while, I made a text engine from scratch (although it is pretty barebones), then I went and added that complex background, which isn't a picture and is actually based on a math equation. Then I realized that the drop shadow under the text and the background tanks performance ESPECIALLY when looking at high indexes like in the hundred millions, so I added the fast mode setting which triggers automatically at really low framerates. lowk its 90% bloat tho like most of the project is part of the demo