# ========= Example Erosion script      ================
# --------- by John Beale Nov. 11/30/96 ----------------

gforge 200    ;# generate a random 200x200 surface
peak .5 .5    ;# position the highest point in the middle
fillbasin 100 ;# iteratively fill in lowest points, take 100 steps
flow          ;# generate a river-flow map using a downhill-flow algorithm
norm 0 0.1    ;# scale flow map to have value ranges in [0...0.1]
sub           ;# subtract this matrix from landscape
               # It is this subtraction which "carves out" the rivers
smooth 0.1    ;# smooth off edges a bit to simulate landslips, weathering

# Do all of this again. And again. And... eventually, it looks like something.
# (Once you've filled in the basins in the first step, you don't need to
#  refill them so much, and the algorithm is very slow. Should be improved.)

fillb 10; flow; norm 0 0.1; sub; smooth 0.1
fillb 10; flow; norm 0 0.1; sub; smooth 0.1
fillb 10; flow; norm 0 0.1; sub; smooth 0.1

# ========= end of erosion script =============================
