22 //assert(legal_moves(8, List((4,1), (1,0)), (2,2)) == |
22 //assert(legal_moves(8, List((4,1), (1,0)), (2,2)) == |
23 // List((3,4), (4,3), (3,0), (0,1), (0,3), (1,4))) |
23 // List((3,4), (4,3), (3,0), (0,1), (0,3), (1,4))) |
24 //assert(legal_moves(8, List((6,6)), (7,7)) == List((6,5), (5,6))) |
24 //assert(legal_moves(8, List((6,6)), (7,7)) == List((6,5), (5,6))) |
25 |
25 |
26 |
26 |
27 //(1c) Complement the two recursive functions below. |
27 //(1c) Complete the two recursive functions below. |
28 // They exhaustively search for open tours starting from the |
28 // They exhaustively search for open tours starting from the |
29 // given path. The first function counts all possible open tours, |
29 // given path. The first function counts all possible open tours, |
30 // and the second collects all open tours in a list of paths. |
30 // and the second collects all open tours in a list of paths. |
31 |
31 |
32 def count_tours(dim: Int, path: Path): Int = ... |
32 def count_tours(dim: Int, path: Path): Int = ... |