Dragon Warrior with a natural terrain generation

Hunter Loftis has been one of the more fun programmers I follow online. He's created a good reputation for himself by taking seemingly complicated graphical programming tasks and creating simple JavaScript that produces FPS engines and to the point of this article - natural terrain generation. 

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.