main_templates4-old/knight4.scala
changeset 483 a2c4c6bf319d
parent 482 20f02c5ff53f
child 484 70c477ad2fd9
--- a/main_templates4-old/knight4.scala	Fri Apr 26 17:29:30 2024 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Part 4 about finding a single tour on "mutilated" chessboards
-//==============================================================
-
-object M4d { 
-
-// !!! Copy any function you need from file knight1.scala !!!
-// !!! or knight2.scala or knight3.scala                  !!! 
-//
-// If you need any auxiliary function, feel free to 
-// implement it, but do not make any changes to the
-// templates below.
-
-type Pos = (Int, Int)
-type Path = List[Pos]
-
-def print_board(dim: Int, path: Path): Unit = {
-  println()
-  for (i <- 0 until dim) {
-    for (j <- 0 until dim) {
-      print(f"${path.reverse.indexOf((i, j))}%4.0f ")
-    }
-    println()
-  } 
-}
-
-// ADD YOUR CODE BELOW
-//======================
-
-// (10)
-def one_tour_pred(dim: Int, path: Path, n: Int, pred: Pos => Boolean): Option[Path] = ???
-
-
-}