cws/core_cw01.tex
changeset 501 3717785f2c37
parent 498 0f1b97538ad4
equal deleted inserted replaced
500:fd7f8aff848c 501:3717785f2c37
    31 apply an automated marking script to them.\medskip
    31 apply an automated marking script to them.\medskip
    32 
    32 
    33 \noindent
    33 \noindent
    34 In addition, the Scala coursework comes with a reference implementation
    34 In addition, the Scala coursework comes with a reference implementation
    35 in form of a \texttt{jar}-file. This allows you to run any test cases on
    35 in form of a \texttt{jar}-file. This allows you to run any test cases on
    36 your own computer. For example you can call \texttt{scala-cli} on the command line
    36 your own computer. For example you can call \texttt{scala} on the command line
    37 with the option \texttt{--extra-jars collatz.jar} and then query any function
    37 with the option \texttt{--extra-jars collatz.jar} and then query any function
    38 from the template file. Say you want to find out what the functions
    38 from the template file. Say you want to find out what the functions
    39 \texttt{collatz} and \texttt{collatz\_max} produce: for this you just
    39 \texttt{collatz} and \texttt{collatz\_max} produce: for this you just
    40 need to prefix them with the object name \texttt{C1}. If you want to
    40 need to prefix them with the object name \texttt{C1}. If you want to
    41 find out what these functions produce for the argument \texttt{6}, you
    41 find out what these functions produce for the argument \texttt{6}, you
    42 would type something like:
    42 would type something like:
    43 
    43 
    44 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small]
    44 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small]
    45 $ scala-cli --extra-jars collatz.jar
    45 $ scala --extra-jars collatz.jar
    46   
    46   
    47 scala> C1.collatz(6)
    47 scala> C1.collatz(6)
    48 ...
    48 ...
    49 scala> C1.collatz_max(6)
    49 scala> C1.collatz_max(6)
    50 ...
    50 ...