cws/cw02.tex
changeset 42 a5106bc13db6
parent 39 c6fe374a5fca
child 45 8399976b77fe
equal deleted inserted replaced
41:1fe8205f6bdb 42:a5106bc13db6
    13 
    13 
    14 
    14 
    15 
    15 
    16 \section*{Coursework 7 (Scala, Knight's Tour)}
    16 \section*{Coursework 7 (Scala, Knight's Tour)}
    17 
    17 
    18 This coursework is worth 10\%. The first part is due on 23 November
    18 This coursework is about depth-first search in Scala and worth
    19 at 11pm; the second, more advanced part, is due on 30 November at
    19 10\%. The first part is due on 23 November at 11pm; the second, more
    20 11pm. You are asked to implement Scala programs that solve various
    20 advanced part, is due on 30 November at 11pm. You are asked to
    21 versions of the \textit{Knight's Tour Problem} on a chessboard.
    21 implement Scala programs that solve various versions of the
       
    22 \textit{Knight's Tour Problem} on a chessboard. Make sure the files
       
    23 you submit can be processed by just calling \texttt{scala
       
    24   <<filename.scala>>}.
    22  
    25  
    23 \subsection*{Disclaimer}
    26 \subsection*{Disclaimer}
    24 
    27 
    25 It should be understood that the work you submit represents
    28 It should be understood that the work you submit represents
    26 your own effort. You have not copied from anyone else. An
    29 your own effort. You have not copied from anyone else. An
    28 uploaded to KEATS, which you can freely use.\bigskip
    31 uploaded to KEATS, which you can freely use.\bigskip
    29 
    32 
    30 \subsection*{Background}
    33 \subsection*{Background}
    31 
    34 
    32 The \textit{Knight's Tour Problem} is about finding a tour such that
    35 The \textit{Knight's Tour Problem} is about finding a tour such that
    33 the knight visits every field on a $n\times n$ chessboard once. For
    36 the knight visits every field on a $n\times n$ chessboard once and
    34 example on a $5\times 5$ chessboard, a knight's tour is as follows:
    37 only once. For example on a $5\times 5$ chessboard, a knight's tour is
       
    38 as follows:
    35 
    39 
    36 
    40 
    37 \chessboard[maxfield=e5, 
    41 \chessboard[maxfield=e5, 
    38             pgfstyle= {[base,at={\pgfpoint{0pt}{-0.5ex}}]text},
    42             pgfstyle= {[base,at={\pgfpoint{0pt}{-0.5ex}}]text},
    39             text = \bf\small 24, markfield=a5,
    43             text = \bf\small 24, markfield=a5,