marking3/knight1_test5.scala
changeset 244 0ab369f53ac1
parent 243 80102fba0a93
child 331 3a9acfc6106b
equal deleted inserted replaced
243:80102fba0a93 244:0ab369f53ac1
     1 
     1 
     2 type Pos = (Int, Int)    // a position on a chessboard 
     2 //type Pos = (Int, Int)    // a position on a chessboard 
     3 type Path = List[Pos]    // a path...a list of positions
     3 //type Path = List[Pos]    // a path...a list of positions
     4 
     4 
     5 def add_pair_urban(x: Pos)(y: Pos): Pos = 
     5 def add_pair_urban(x: Pos)(y: Pos): Pos = 
     6   (x._1 + y._1, x._2 + y._2)
     6   (x._1 + y._1, x._2 + y._2)
     7 
     7 
     8 def is_legal_urban(dim: Int, path: Path)(x: Pos): Boolean = 
     8 def is_legal_urban(dim: Int, path: Path)(x: Pos): Boolean =