equal
  deleted
  inserted
  replaced
  
    
    
         | 
     1 // Core Part about finding a single tour for a board using the  | 
         | 
     2 // Warnsdorf Rule  | 
         | 
     3 //==============================================================  | 
         | 
     4   | 
         | 
     5 object M4b { | 
         | 
     6   | 
         | 
     7 // !!! Copy any function you need from file knight1.scala !!!  | 
         | 
     8 //  | 
         | 
     9 // If you need any auxiliary functions, feel free to   | 
         | 
    10 // implement them, but do not make any changes to the  | 
         | 
    11 // templates below.  | 
         | 
    12   | 
         | 
    13 type Pos = (Int, Int)    // a position on a chessboard   | 
         | 
    14 type Path = List[Pos]    // a path...a list of positions  | 
         | 
    15   | 
         | 
    16 // ADD YOUR CODE BELOW  | 
         | 
    17 //======================  | 
         | 
    18   | 
         | 
    19 //(6)   | 
         | 
    20 def ordered_moves(dim: Int, path: Path, x: Pos) : List[Pos] = ???  | 
         | 
    21   | 
         | 
    22   | 
         | 
    23 //(7)   | 
         | 
    24 def first_closed_tour_heuristics(dim: Int, path: Path) : Option[Path] = ???  | 
         | 
    25   | 
         | 
    26   | 
         | 
    27 //(8) Same as (7) but searches for *non-closed* tours. This   | 
         | 
    28 //    version of the function will be called with dimensions of   | 
         | 
    29 //    up to 30 * 30.  | 
         | 
    30   | 
         | 
    31 def first_tour_heuristics(dim: Int, path: Path) : Option[Path] = ???  | 
         | 
    32   | 
         | 
    33   | 
         | 
    34   | 
         | 
    35 }  |