Esempio n. 1
0
 public Node(Puzzle puzzle,
             Node present, int depth, PuzzlePathGraph ownGraph)
 {
     this.Puzzle   = puzzle;
     this.Present  = present;
     this.Depth    = depth;
     this.ownGraph = ownGraph;
 }
Esempio n. 2
0
 private static void PrintResult(int createdNodeCount,
                                 int skippedNodeCount, List <PuzzlePathGraph.Node> path)
 {
     Console.WriteLine($"Result: total depth {path.Count - 1}, created" +
                       $" {createdNodeCount} and skipped {skippedNodeCount} nodes");
     for (int i = 0; i < path.Count; i++)
     {
         string depth = i.ToString().PadLeft(path.Count.ToString().Length);
         Console.WriteLine($"  (depth {depth}) {path[i].Puzzle}, and " +
                           $"{PuzzlePathGraph.ActionToString(path[i].NextAction)}");
     }
 }