equal
deleted
inserted
replaced
1 // Part 2 about finding a single tour for a board |
1 // Part 2 about finding a single tour for a board |
2 //================================================ |
2 //================================================ |
3 |
3 |
4 |
4 type Pos = (Int, Int) // a position on a chessboard |
5 type Pos = (Int, Int) |
5 type Path = List[Pos] // a path...a list of positions |
6 type Path = List[Pos] |
|
7 |
6 |
8 def print_board(dim: Int, path: Path): Unit = { |
7 def print_board(dim: Int, path: Path): Unit = { |
9 println |
8 println |
10 for (i <- 0 until dim) { |
9 for (i <- 0 until dim) { |
11 for (j <- 0 until dim) { |
10 for (j <- 0 until dim) { |