equal
deleted
inserted
replaced
161 setpieces={Ng7, Nb2}, |
161 setpieces={Ng7, Nb2}, |
162 boardfontsize=12pt,labelfontsize=9pt]} |
162 boardfontsize=12pt,labelfontsize=9pt]} |
163 |
163 |
164 \subsection*{Reference Implementation} |
164 \subsection*{Reference Implementation} |
165 |
165 |
166 You\alert{} need to download \texttt{knight1.jar} from KEATS. The one |
166 \mbox{}\alert{}\textcolor{red}{You need to download \texttt{knight1.jar} from KEATS. The one |
167 supplied with github does not contain the correct code. See Scala coursework |
167 supplied with github does not contain the correct code. See Scala coursework |
168 section. \medskip |
168 section on KEATS.}\medskip |
169 |
169 |
170 \noindent |
170 \noindent |
171 This Scala part comes with three reference implementations in form of |
171 This Scala part comes with three reference implementations in form of |
172 \texttt{jar}-files. This allows you to run any test cases on your own |
172 \texttt{jar}-files. This allows you to run any test cases on your own |
173 computer. For example you can call Scala on the command line with the |
173 computer. For example you can call Scala on the command line with the |
252 occurs only once in the path, and each move follows the rules of how a |
252 occurs only once in the path, and each move follows the rules of how a |
253 knight moves (see above for the rules). |
253 knight moves (see above for the rules). |
254 |
254 |
255 |
255 |
256 \subsubsection*{Tasks (file knight1.scala)} |
256 \subsubsection*{Tasks (file knight1.scala)} |
|
257 |
|
258 |
257 |
259 |
258 \begin{itemize} |
260 \begin{itemize} |
259 \item[(1)] Implement an \texttt{is\_legal} function that takes a |
261 \item[(1)] Implement an \texttt{is\_legal} function that takes a |
260 dimension, a path and a position as arguments and tests whether the |
262 dimension, a path and a position as arguments and tests whether the |
261 position is inside the board and not yet element in the |
263 position is inside the board and not yet element in the |
307 |
309 |
308 \subsection*{Core Part (6 Marks)} |
310 \subsection*{Core Part (6 Marks)} |
309 |
311 |
310 |
312 |
311 \subsubsection*{Tasks (file knight1.scala cont.)} |
313 \subsubsection*{Tasks (file knight1.scala cont.)} |
|
314 |
|
315 \mbox{}\alert{}\textcolor{red}{You need to copy your \texttt{knight1.scala} |
|
316 from the preliminary part to the main part and then solve Tasks 4 and 5 |
|
317 inside the copied file. Do not forget to ``git add'' the file for |
|
318 pushing the results to the directory \texttt{main4}.}\medskip |
|
319 |
312 |
320 |
313 \begin{itemize} |
321 \begin{itemize} |
314 \item[(4)] Implement a \texttt{first}-function. This function takes a list of |
322 \item[(4)] Implement a \texttt{first}-function. This function takes a list of |
315 positions and a function $f$ as arguments; $f$ is the name we give to |
323 positions and a function $f$ as arguments; $f$ is the name we give to |
316 this argument). The function $f$ takes a position as argument and |
324 this argument). The function $f$ takes a position as argument and |