diff -r 11396c17cd8b -r 716042628398 cws/cw02.tex --- a/cws/cw02.tex Fri Nov 10 09:23:23 2017 +0000 +++ b/cws/cw02.tex Tue Nov 14 13:14:47 2017 +0000 @@ -18,33 +18,46 @@ This coursework is worth 10\%. It is about searching and backtracking. The first part is due on 23 November at 11pm; the -second, more advanced part, is due on 30 November at 11pm. You are +second, more advanced part, is due on 21 December at 11pm. You are asked to implement Scala programs that solve various versions of the \textit{Knight's Tour Problem} on a chessboard. Note the second part might include material you have not yet seen in the first two -lectures. Make sure the files you submit can be processed by just -calling \texttt{scala <>}.\bigskip +lectures. \bigskip \noindent -\textbf{Important:} Do not use any mutable data structures in your -submissions! They are not needed. This means you cannot use -\texttt{ListBuffer}s, for example. Do not use \texttt{return} in your -code! It has a different meaning in Scala, than in Java. -Do not use \texttt{var}! This declares a mutable variable. Feel free to -copy any code you need from files \texttt{knight1.scala}, -\texttt{knight2.scala} and \texttt{knight3.scala}. Make sure the -functions you submit are defined on the ``top-level'' of Scala, not -inside a class or object. Also note that the running time of -each part will be restricted to a maximum of 360 seconds on my -laptop. +\textbf{Important:} + +\begin{itemize} +\item Make sure the files you submit can be processed by just calling\\ +\mbox{\texttt{scala <>}} on the commandline. + +\item Do not use any mutable data structures in your +submissions! They are not needed. This means you cannot use +\texttt{ListBuffer}s, for example. + +\item Do not use \texttt{return} in your code! It has a different + meaning in Scala, than in Java. +\item Do not use \texttt{var}! This declares a mutable variable. Only + use \texttt{val}! + +\item Do not use any parallel collections! No \texttt{.par} therefore! + Our testing and marking infrastructure is not set up for it. +\end{itemize} + +\noindent +Also note that the running time of each part will be restricted to a +maximum of 360 seconds on my laptop: If you calculate a result once, +try to avoid to calculate the result again. Feel free to copy any code +you need from files \texttt{knight1.scala}, \texttt{knight2.scala} and +\texttt{knight3.scala}. \subsection*{Disclaimer} It should be understood that the work you submit represents your own effort. You have not copied from anyone else. An exception is the Scala code I showed during the lectures or -uploaded to KEATS, which you can freely use.\medskip +uploaded to KEATS, which you can freely use. \subsection*{Background} @@ -52,7 +65,6 @@ the knight visits every field on an $n\times n$ chessboard once. For example on a $5\times 5$ chessboard, a knight's tour is: - \chessboard[maxfield=d4, pgfstyle= {[base,at={\pgfpoint{0pt}{-0.5ex}}]text}, text = \small 24, markfield=Z4, @@ -81,7 +93,7 @@ text = \small 21, markfield=c0, text = \small 2, markfield=d0 ] - + \noindent The tour starts in the right-upper corner, then moves to field $(3,2)$, then $(4,0)$ and so on. There are no knight's tours on