--- a/main_templates4/knight2.scala Sat Oct 08 00:30:51 2022 +0100
+++ b/main_templates4/knight2.scala Tue Nov 01 15:03:48 2022 +0000
@@ -4,7 +4,6 @@
object M4b {
-
// !!! Copy any function you need from file knight1.scala !!!
//
// If you need any auxiliary functions, feel free to
@@ -14,21 +13,14 @@
type Pos = (Int, Int) // a position on a chessboard
type Path = List[Pos] // a path...a list of positions
+// ADD YOUR CODE BELOW
+//======================
-//(6) Complete the function that calculates a list of onward
-// moves like in (2) but orders them according to Warnsdorf’s
-// rule. That means moves with the fewest legal onward moves
-// should come first.
-
-
+//(6)
def ordered_moves(dim: Int, path: Path, x: Pos) : List[Pos] = ???
-//(7) Complete the function that searches for a single *closed*
-// tour using the ordered_moves function from (6). This
-// function will be tested on a 6 x 6 board.
-
-
+//(7)
def first_closed_tour_heuristics(dim: Int, path: Path) : Option[Path] = ???