To generate a planet, one must first figure out where all the tectonic plates are. This picture shows the initial assignment of plates on our randomly assigned planet. Colours indicate the plates, the black identifies the plate edges.
The next code to write is figuring out how the plates will collide with each. Either to create mountain ranges or spread apart creating a subversion and ocean.
Tectonic plates with exaggerated plate elevations. The white spikes a the centre of the plates.