Messing with code - I took a code from Ira Greenberg's book Creative Coding and Computational Art and changed the fixed values to random values to generate new combinations of the geometry each time the applet is run.
Open in a new tab - link to Processing Sketch