main_templates4-old/knight3.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 08 Dec 2023 00:54:36 +0000
changeset 481 e03a0100ec46
parent 476 7550c816187a
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
214
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
// Finding a single tour on a "mega" board
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
//=========================================
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
397
085fefce672e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
     4
object M4c {
214
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
// !!! Copy any function you need from file knight1.scala !!!
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
// !!! or knight2.scala                                   !!! 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
//
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
// If you need any auxiliary function, feel free to 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
// implement it, but do not make any changes to the
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
// templates below.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
type Pos = (Int, Int)    // a position on a chessboard 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
type Path = List[Pos]    // a path...a list of positions
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
428
cdfa6a293453 updated solutions and templates
Christian Urban <christian.urban@kcl.ac.uk>
parents: 397
diff changeset
    17
// ADD YOUR CODE BELOW
cdfa6a293453 updated solutions and templates
Christian Urban <christian.urban@kcl.ac.uk>
parents: 397
diff changeset
    18
//======================
214
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
428
cdfa6a293453 updated solutions and templates
Christian Urban <christian.urban@kcl.ac.uk>
parents: 397
diff changeset
    21
//(9) 
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 296
diff changeset
    22
def tour_on_mega_board(dim: Int, path: Path) : Option[Path] = ???
214
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
296
12dc251fc47e updated
Christian Urban <urbanc@in.tum.de>
parents: 214
diff changeset
    24
}