This is a 1S1S way to randomly generate a line to be used as terrain, and then redraw it with the exact same distances and color.