Loftis used the midpoint displacement algorithm to generate 3D geographic maps that even had a sea level. Brilliant, but honestly a little too complex for my blood.
What I wanted was the ability to create simple 2D maps that resonated with the RPGs I played as a kid and teen, and so I altered Loftis' algorithm and generator to produce geographic maps using the art from the 1989 game Dragon Warrior. These maps follow the geographic generation algorithm but instead of producing three dimensional height, instead mountains, hills, sand, grass and water indicate elevation.
Loftis did a fantastic job communicating a simple but powerful algorithm. I've seen lots of tricks for terrain generation for games and writers, but this application is by far my favorite as each load of the program is a surprise.
The code is available on github and if anyone wants to fork it and add caves, villages and castles, I look forward to any additions.