This is a port of the xmountains fractal landscape generator to JavaScript.
The code is here
This is a relatively old piece of code the first version original C program was written back in 1991 which makes the code pretty much as old as the web itself. The final version of the fractal generation code has been ported to various languages including Java and now JavaScript. This is the code I tend to use when trying to properly get to grips with a new programming language so the code style can be a bit idiosyncratic as a result.