--- a/progs/knight.scala Mon Oct 31 10:28:32 2016 +0000
+++ b/progs/knight.scala Mon Oct 31 10:41:23 2016 +0000
@@ -18,8 +18,8 @@
0 <= x._1 && 0 <= x._2 && x._1 < n && x._2 < n
def moves(n: Int)(x: (Int, Int)): List[(Int, Int)] = {
- Set((1, 2),(2, 1),(2, -1),(1, -2),
- (-1, -2),(-2, -1),(-2, 1),(-1, 2)).map(add_pair(x)).filter(is_legal(n))
+ List((1, 2),(2, 1),(2, -1),(1, -2),
+ (-1, -2),(-2, -1),(-2, 1),(-1, 2)).map(add_pair(x)).filter(is_legal(n))
}
def tour(n: Int)(steps: List[(Int, Int)]): Unit = {