# HG changeset patch # User Christian Urban # Date 1701171948 0 # Node ID 34b3aeb65fbed3327a4b45c40b48ffe64224c983 # Parent ae9782e62bdd4e73284368a47cc025bd7af6342a updated diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw01.pdf Binary file hws/hw01.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw02.pdf Binary file hws/hw02.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw03.pdf Binary file hws/hw03.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw04.pdf Binary file hws/hw04.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw05.pdf Binary file hws/hw05.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw06.pdf Binary file hws/hw06.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw07.pdf Binary file hws/hw07.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw08.pdf Binary file hws/hw08.pdf has changed diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw08.tex --- a/hws/hw08.tex Tue Nov 28 11:42:31 2023 +0000 +++ b/hws/hw08.tex Tue Nov 28 11:45:48 2023 +0000 @@ -13,18 +13,18 @@ \item Write a program in the WHILE-language that calculates the factorial function. -\begin{lstlisting} -write "factorial: "; -read n; -minus1 := 1; -while n > 0 do { -minus1 := minus1 * n; -n := n - 1 -}; -write "Result: "; -write minus1 ; -write "\n" -\end{lstlisting} +%\begin{lstlisting} +%write "factorial: "; +%read n; +%minus1 := 1; +%while n > 0 do { +%minus1 := minus1 * n; +%n := n - 1 +%}; +%write "Result: "; +%write minus1 ; +%write "\n" +%\end{lstlisting} \item What optimisations could a compiler perform when compiling a WHILE-program? diff -r ae9782e62bdd -r 34b3aeb65fbe hws/hw09.pdf Binary file hws/hw09.pdf has changed