214
|
1 |
// Finding a single tour on a "mega" board
|
|
2 |
//=========================================
|
|
3 |
|
296
|
4 |
object CW8c {
|
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 |
|
|
17 |
//(9) Implement a function that searches for a
|
|
18 |
// you have to be careful to write a tail-recursive version as this
|
|
19 |
// function will be called with dimensions of up to 70 * 70
|
|
20 |
// and starting field (0, 0). It has to produce a solution within
|
|
21 |
// 30 seconds.
|
|
22 |
|
|
23 |
|
|
24 |
//def tour_on_mega_board(dim: Int, path: Path) : Option[Path] = ...
|
|
25 |
|
296
|
26 |
}
|