# HG changeset patch # User Christian Urban # Date 1763118883 0 # Node ID 3717785f2c3707e49ec4421f256e64a17d6c7387 # Parent fd7f8aff848caf619d1b576e1a038921e8189aa9 updated diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw01.pdf Binary file cws/core_cw01.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw01.tex --- a/cws/core_cw01.tex Fri Nov 14 10:57:21 2025 +0000 +++ b/cws/core_cw01.tex Fri Nov 14 11:14:43 2025 +0000 @@ -33,7 +33,7 @@ \noindent In addition, the Scala coursework comes with a reference implementation in form of a \texttt{jar}-file. This allows you to run any test cases on -your own computer. For example you can call \texttt{scala-cli} on the command line +your own computer. For example you can call \texttt{scala} on the command line with the option \texttt{--extra-jars collatz.jar} and then query any function from the template file. Say you want to find out what the functions \texttt{collatz} and \texttt{collatz\_max} produce: for this you just @@ -42,7 +42,7 @@ would type something like: \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] -$ scala-cli --extra-jars collatz.jar +$ scala --extra-jars collatz.jar scala> C1.collatz(6) ... diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw02.pdf Binary file cws/core_cw02.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw02.tex --- a/cws/core_cw02.tex Fri Nov 14 10:57:21 2025 +0000 +++ b/cws/core_cw02.tex Fri Nov 14 11:14:43 2025 +0000 @@ -34,7 +34,7 @@ \noindent In addition, the Scala part comes with reference implementations in form of \texttt{jar}-files. This allows you to run -any test cases on your own computer. For example you can call \texttt{scala-cli} on +any test cases on your own computer. For example you can call \texttt{scala} on the command line with the option \texttt{--extra-jars docdiff.jar} and then query any function from the template file. Say you want to find out what the function \texttt{occurrences} produces: for this you just need @@ -43,7 +43,7 @@ you would type something like: \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] -$ scala-cli --extra-jars docdiff.jar +$ scala --extra-jars docdiff.jar scala> C2.occurrences(List("a", "b", "b")) ... diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw03.pdf Binary file cws/core_cw03.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/core_cw03.tex --- a/cws/core_cw03.tex Fri Nov 14 10:57:21 2025 +0000 +++ b/cws/core_cw03.tex Fri Nov 14 11:14:43 2025 +0000 @@ -37,7 +37,7 @@ This Scala assignment comes with two reference implementations in form of \texttt{jar}-files. This allows you to run any test cases on your own computer. For example you can -call scala-cli on the command line with the option \texttt{--extra-jars +call scala on the command line with the option \texttt{--extra-jars postfix.jar} and then query any function from the \texttt{postfix.scala} file (similarly for file \texttt{postfix2.scala}). As usual you have to prefix the calls with \texttt{C3a} and @@ -45,7 +45,7 @@ \begin{lstlisting}[xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small] -$ scala-cli --extra-jars postfix.jar +$ scala --extra-jars postfix.jar scala> C3a.syard(C3a.split("( 5 + 7 ) * 2")) val res0: C3a.Toks = List(5, 7, +, 2, *) diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw02.pdf Binary file cws/main_cw02.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw02.tex --- a/cws/main_cw02.tex Fri Nov 14 10:57:21 2025 +0000 +++ b/cws/main_cw02.tex Fri Nov 14 11:14:43 2025 +0000 @@ -42,7 +42,7 @@ \noindent In addition, the Scala part comes with a reference implementation in form of \texttt{jar}-files. This allows you to run -any test cases on your own computer. For example you can call \texttt{scala-cli} on +any test cases on your own computer. For example you can call \texttt{scala} on the command line with the option \texttt{--extra-jars wordle.jar} and then query any function from the template file. Say you want to find out what the function \texttt{} produces: for this you just need @@ -51,7 +51,7 @@ you would type something like: \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] -$ scala-cli --extra-jars wordle.jar +$ scala --extra-jars wordle.jar scala> val secretsURL = | """https://urbanchr.github.io/pep/wordle.txt""" diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw03.pdf Binary file cws/main_cw03.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw04.pdf Binary file cws/main_cw04.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw05.pdf Binary file cws/main_cw05.pdf has changed diff -r fd7f8aff848c -r 3717785f2c37 cws/main_cw05.tex --- a/cws/main_cw05.tex Fri Nov 14 10:57:21 2025 +0000 +++ b/cws/main_cw05.tex Fri Nov 14 11:14:43 2025 +0000 @@ -43,14 +43,14 @@ As usual, this Scala assignment comes with a reference implementation in form of two \texttt{jar}-files. You can download them from KEATS. They allow you to run any test cases on your own computer. For example you -can call \texttt{scala-cli} on the command line with the option \texttt{--extra-jars bf.jar} +can call \texttt{scala} on the command line with the option \texttt{--extra-jars bf.jar} and then query any function from the \texttt{bf.scala} template file. You have to prefix the calls with \texttt{M5a} and \texttt{M5b}, respectively. For example \begin{lstlisting}[language={},xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small] -$ scala-cli --extra-jars bf.jar +$ scala --extra-jars bf.jar scala> import M5a._ scala> run(load_bff("sierpinski.bf")) ; () * diff -r fd7f8aff848c -r 3717785f2c37 progs/mandelbrot.sc --- a/progs/mandelbrot.sc Fri Nov 14 10:57:21 2025 +0000 +++ b/progs/mandelbrot.sc Fri Nov 14 11:14:43 2025 +0000 @@ -122,8 +122,8 @@ val d_x = (end.re - start.re) / W val d_y = (end.im - start.im) / H - for (y <- (0 until H).par) { - for (x <- (0 until W).par) { + for (y <- (0 until H)) { + for (x <- (0 until W)) { val c = start + x * d_x + y * d_y * i val iters = iterations(c, max)