private static void RunPuzzle(Puzzle puzzle, int maxExecution  = 100)
        {
            var engine = new SolverEngine();
            //engine.WriteLog = (message) => { Console.WriteLine(message); };
            engine.LoadPuzzle(puzzle);

            long elapsed = engine.TrySolveToEnd();
            Console.WriteLine(puzzle.Name.PadRight(19) + " : " +
                              "e " + elapsed.ToString().PadRight(3) + ", " +
                              "g " + engine.GuessedMoves().ToString().PadRight(3) + ", " +
                              "u " + engine.Undos.ToString().PadRight(3));

            bool solved = engine.IsFullySolved();
            Assert.IsTrue(solved, "Could not solve puzzle " + puzzle.Name);
            Assert.LessOrEqual(elapsed, maxExecution, "Elapsed milliseconds must be less than " + maxExecution);
        }
 public RandomMoveAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 3
0
 private void InitializeEngine()
 {
     engine = new SolverEngine();
     engine.WriteLog = (message) =>
     {
         Log.Text += message + Environment.NewLine;
     };
 }
 public NakedPairsInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 private void InitializeEngine()
 {
     engine = new SolverEngine();
     engine.WriteLog = (message) =>
     {
         WriteLog(message);
     };
 }
Esempio n. 6
0
 public NakedPairsInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public HiddenPairsInRowAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public NakedTriplesInColumnAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 9
0
 public NakedPairsInColumnAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 10
0
 public RefreshPossiblesAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 11
0
 public NakedPairsInRowAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 12
0
 public Algorithm(SolverEngine engine)
 {
     _engine = engine;
 }
 public SingleInRowAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 14
0
 public HiddenPairsInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 15
0
 public SingleInColumnAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 16
0
 public Algorithm(SolverEngine engine)
 {
     _engine = engine;
 }
 public RefreshPossiblesAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public NakedPairsInColumnAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public HiddenPairsInRowAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 20
0
 public NakedTriplesInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 21
0
 public NakedTriplesInColumnAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public SingleInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
Esempio n. 23
0
 public PointingPairsAlgorithm(SolverEngine engine, Direction direction)
     : base(engine)
 {
     _direction = direction;
 }
 public NakedTriplesInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public PointingPairsAlgorithm(SolverEngine engine, Direction direction)
     : base(engine)
 {
     _direction = direction;
 }
 public SingleInSquareAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }
 public SingleInRowAlgorithm(SolverEngine engine)
     : base(engine)
 {
 }