The program below will generate a random topological map. To see the JavaScript source code, visit http://thiscouldbebetter.wordpress.com/2013/08/12/generating-a-random-landscape-in-javascript/.

The program will show each step involved in interpolating the landscape as a separate image. Note that the left side of the final landscape always seems to have a 2-pixel black line running down it, which indicates that something didn't get calculated correctly. I'm not sure exactly what's causing that yet. Probably an off-by-one error somewhere.