Diamond-square algorithm is a simple way to generate maps by using fractal approach. The idea is to generate recursively a point based on the values of its neighbors and an additional fluctuation.
The main disadvantage is that landscapes aren't realistic and there exist visible edges created during recursive slicing of the terrain during recursive computing
Below you may see how the diamond-square algorithm works. Availability to change perspective is not part of the algorithm, but I've added it to make the visualisation more user-friendly.
To check exactly, how the scripts are working please take a look on the source code of this page.