main_marking4/knight1_test3b.scala
changeset 424 daf561a83ba6
parent 387 6282b88511d8
child 463 0315d9983cd0
equal deleted inserted replaced
423:e9d14d58be3c 424:daf561a83ba6
       
     1 import M4a._
       
     2 //type Pos = (Int, Int)    // a position on a chessboard 
       
     3 //type Path = List[Pos]    // a path...a list of positions
       
     4 
       
     5 /*
       
     6 def count_all_tours_urban(dim: Int) = {
       
     7   for (i <- (0 until dim).toList; 
       
     8        j <- (0 until dim).toList) yield count_tours(dim, List((i, j)))
       
     9 }
       
    10 */
       
    11 
       
    12 def count_all_tours_urban(dim: Int) = {
       
    13   for (i <- (0 until 3).toList; 
       
    14        j <- (0 until dim).toList) yield count_tours(dim, List((i, j)))
       
    15 }
       
    16 
       
    17 
       
    18 assert(count_all_tours_urban(5) == List(304, 0, 56, 0, 304, 0, 56, 0, 56, 0, 56, 0, 64, 0, 56))
       
    19