This is actually the javascript version but the X version looks pretty much the same.
Xmountains is a fractal terrain generator written by Stephen Booth There is also a Java version, a Android and a Javascript version of this code.
If you find any bugs send me an Email