I've tried to implement the diamond-square algorithm in python, but I seem to be bogged down in the workings of the language... I have a 'quad' class that has 9 2D (custom) points inside it:
- top left
- top right
- top middle
- bottom left
- bottom right
- bottom middle
- left middle
- centre
- right middle
These 9 are held in a dictionary.
There are also 4 'child' quads in a dictionary for every quad.
- top left
- top right
- bottom left
- bottom right
The problem I have is that when I create the child quads for a quad, they mess up the fields of the parent's 2D points, and I have no idea why.
Source code (Python 3.2): http://pastebin.com/5Ywz4anY