\section{Source Code Listings}

\lstloadlanguages{C++,Java}
\lstset{labelstyle=\tiny, visiblespaces=false, visibletabs=false,
	frame=trbl, basicstyle=\tiny, stringspaces=false}

This appendix contains several programs written by the authors to demonstrate various algorithms related to this report.  In order to fit the source code in the space available, it must be rendered in a small font.  On some computers, this font can appear as grey lines.  If this is the case, please zoom in until text appears.

\subsection{Mandelbrot and Julia Set Generator}
In section \ref{sec:julia} on page \pageref{sec:julia}, we described our Mandelbrot and Julia set rendering program.  Below is a listing of the source code for this program.

\label{source:mandelbrot}
\lstset{language=C++}
\lstinputlisting{listings/mandelbrot.cpp}

\subsection{Box-Counting Dimension Calculator}
Section \ref{sec:dimension:boxcounting} on page \pageref{sec:dimension:boxcounting} described an algorithm for calculating the fractal dimension of an image file.  Below is the source code for our box counting fractal dimension calculator.

\label{source:boxcounting}
\lstset{language=C++}
\lstinputlisting{listings/boxcount.cpp}

\subsection{Fractal Music Generator}
Sections \ref{sec:music:example1} through \ref{sec:music:example3} starting on page \pageref{sec:music:example1} described three example algorithms for generating fractal music.  The listings below are a set of Java\trademark files that implement these three examples.  To run the examples, load \emph{fractalmusic.html} in a web browser with Java\trademark Applet support enabled.
 
\label{source:fractalNoteGenerator}
\lstset{language=Java}
\lstinputlisting{listings/FractalNoteGenerator.java}
\label{source:fractalMultipleNoteGenerator}
\lstinputlisting{listings/FractalMultipleNoteGenerator.java}
\label{source:fractalChordGenerator}
\lstinputlisting{listings/FractalChordGenerator.java}
\lstinputlisting{listings/IteratedFunction.java}
\lstinputlisting{listings/RandomFunction.java}
\lstinputlisting{listings/FractalMusicApplet.java}
\lstset{language=HTML}
\lstinputlisting{listings/fractalmusic.html}

