Exemplo n.º 1
0
        public MainWindow()
        {
            _solver = new ScrabbleSolverEngine();
            _solver.NewLogMessage   += Solver_NewLogMessage;
            _solver.ProgressChanged += Solver_OnProgressChanged;

            Messages = new ObservableCollection <string>();

            InitializeComponent();

            DataContext = this;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Prints a set of Solutions to the console.
        /// </summary>
        /// <param name="solutions">An IEnumerable of solutions.  If you set this to null, it will print all the valid solutions the engine must recently found.</param>
        public static void PrintSolutionsToConsole(this ScrabbleSolverEngine engine, IEnumerable <ScrabbleSolution> solutions = null)
        {
            if (solutions == null)
            {
                solutions = engine.UniqueSolutions;
            }

            foreach (var solution in solutions)
            {
                solution.PrintSolutionToConsole();
            }
        }