# HG changeset patch # User Christian Urban # Date 1384075621 0 # Node ID 1f98d215df712a237d38c170782f4bc4e742361e # Parent 50e8dcd95ae3af5a4d8fd4be9d57612f2540e85a added material diff -r 50e8dcd95ae3 -r 1f98d215df71 coursework/cw02.pdf Binary file coursework/cw02.pdf has changed diff -r 50e8dcd95ae3 -r 1f98d215df71 coursework/cw02.tex --- a/coursework/cw02.tex Sun Nov 03 11:10:07 2013 +0100 +++ b/coursework/cw02.tex Sun Nov 10 09:27:01 2013 +0000 @@ -111,7 +111,7 @@ \noindent Once you have implemented all regular expressions for 1 - 9, then -give the token sequence for the Fibonacci program shown below. +give the token sequence for the Fibonacci program shown below in Fig.~\ref{fib}. \subsection*{Question 2 (marked with 1\%)} @@ -138,15 +138,19 @@ and ``three-nested-loops'' program shown below. For example, printing a variable \texttt{x} in the WHILE language can be done by using the command \mbox{\texttt{write x}}. - +\begin{figure}[h] \begin{center} \mbox{\lstinputlisting[language=while]{../progs/fib.while}} \end{center} +\caption{Fibonacci program in the WHILE language.\label{fib}} +\end{figure} +\begin{figure}[h] \begin{center} \mbox{\lstinputlisting[language=while]{../progs/loops.while}} \end{center} - +\caption{The three-nested-loops program in the WHILE language. Usually used for timing measurements.\label{loop}} +\end{figure} \end{document} diff -r 50e8dcd95ae3 -r 1f98d215df71 hws/hw06.pdf Binary file hws/hw06.pdf has changed