| author | Christian Urban <christian.urban@kcl.ac.uk> | 
| Thu, 02 Nov 2023 12:37:58 +0000 | |
| changeset 470 | 195ad66315d9 | 
| parent 425 | 6e990ae2c6a3 | 
| permissions | -rw-r--r-- | 
| 214 | 1  | 
// Finding a single tour on a "mega" board  | 
2  | 
//=========================================  | 
|
3  | 
||
| 397 | 4  | 
object M4c {
 | 
| 214 | 5  | 
|
6  | 
// !!! Copy any function you need from file knight1.scala !!!  | 
|
7  | 
// !!! or knight2.scala !!!  | 
|
8  | 
//  | 
|
9  | 
// If you need any auxiliary function, feel free to  | 
|
10  | 
// implement it, but do not make any changes to the  | 
|
11  | 
// templates below.  | 
|
12  | 
||
13  | 
||
14  | 
type Pos = (Int, Int) // a position on a chessboard  | 
|
15  | 
type Path = List[Pos] // a path...a list of positions  | 
|
16  | 
||
| 
425
 
6e990ae2c6a3
updated solutions and templates
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents: 
397 
diff
changeset
 | 
17  | 
// ADD YOUR CODE BELOW  | 
| 
 
6e990ae2c6a3
updated solutions and templates
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents: 
397 
diff
changeset
 | 
18  | 
//======================  | 
| 214 | 19  | 
|
20  | 
||
| 
425
 
6e990ae2c6a3
updated solutions and templates
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents: 
397 
diff
changeset
 | 
21  | 
//(9)  | 
| 347 | 22  | 
def tour_on_mega_board(dim: Int, path: Path) : Option[Path] = ???  | 
| 214 | 23  | 
|
| 296 | 24  | 
}  |