Indeed, switching the loops is valid and might or might not give you an additional speedup. I had hoped, that someone figures this out :-).
However I think in order to understand the basic algorithm the way in the readme is the better one.
Do you know of referenceable pseudocode (or real code) for that somewhere? I've tried modifying your code to switch the loops, but it always comes out garbled; clearly I'm messing up somewhere in the refactoring process, but I don't have enough experience with this algorithm to figure out where!
Such good points and so obvious (now that you said them) that first I really want to retract my comment and second now I feel like coding up a terrain generator today. Duh, Doom did (famously) switch the loops for similar reasons!
s-macke|6 years ago
gliese1337|6 years ago
dahart|6 years ago