Source Code

I wrote my Lindenmayer fractal generator program in C# using Microsoft Visual Studio .NET. The source code consists of two files, briefly described below with links to text files containing the commented code.

Click here to download the entire Visual Studio .NET solution in a ZIP file.

Lindenmayer.cs - This file implements the Lindenmayer class, whose constructor takes the name and grammar of a fractal as input. Once a Lindenmayer object has been created, its Iterate() and Output() functions can be called as desired.

LindenmayerMain.cs - This file is the main entry point for the program. It contains the grammars for all of the example fractals. It creates a separate Lindenmayer object for each fractal and successively calls the Output() and Iterate() functions a given number of times to produce the separate PostScript files for each iteration. Once all fractals have been generated, it creates the file "_showall.ps", which runs the other PostScript files to create a slide show of all iterations of all fractals produced.