Dark theme

Answer


So, here's one answer: landsacpe.py. The secret is to use the x value for the height in the first case, and x + y in the second case.

You might like to think about more complicated landscapes. Can you get it sloping up from the middle towards the Northwest and Southeast to make a river valley? Can you make a pyramid in the centre? Landscape generation algorithms have become important since computer games started using them to create varied landscapes. You can find out more about this on the Wikipedia site for the classic Diamond-square algorithm, or, for Python, this nice writeup on Midpoint Displacement by Steve Losh along with the other algorithms linked to it.