cws/main_cw02.tex
changeset 501 3717785f2c37
parent 499 2f33c51cac48
equal deleted inserted replaced
500:fd7f8aff848c 501:3717785f2c37
    40 and apply an automated marking script to them.\medskip
    40 and apply an automated marking script to them.\medskip
    41 
    41 
    42 \noindent
    42 \noindent
    43 In addition, the Scala part comes with a reference
    43 In addition, the Scala part comes with a reference
    44 implementation in form of \texttt{jar}-files. This allows you to run
    44 implementation in form of \texttt{jar}-files. This allows you to run
    45 any test cases on your own computer. For example you can call \texttt{scala-cli} on
    45 any test cases on your own computer. For example you can call \texttt{scala} on
    46 the command line with the option \texttt{--extra-jars wordle.jar} and then
    46 the command line with the option \texttt{--extra-jars wordle.jar} and then
    47 query any function from the template file. Say you want to find out
    47 query any function from the template file. Say you want to find out
    48 what the function \texttt{} produces: for this you just need
    48 what the function \texttt{} produces: for this you just need
    49 to prefix it with the object name \texttt{M2}.  If you want to find out what
    49 to prefix it with the object name \texttt{M2}.  If you want to find out what
    50 these functions produce for the list \texttt{List("a", "b", "b")},
    50 these functions produce for the list \texttt{List("a", "b", "b")},
    51 you would type something like:
    51 you would type something like:
    52 
    52 
    53 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small]
    53 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small]
    54 $ scala-cli --extra-jars wordle.jar
    54 $ scala --extra-jars wordle.jar
    55 scala> val secretsURL =
    55 scala> val secretsURL =
    56      | """https://urbanchr.github.io/pep/wordle.txt"""
    56      | """https://urbanchr.github.io/pep/wordle.txt"""
    57 
    57 
    58 scala> M2.get_wordle_list(secretsURL)
    58 scala> M2.get_wordle_list(secretsURL)
    59 val res0: List[String] = List(aahed, aalii, ...)
    59 val res0: List[String] = List(aahed, aalii, ...)