Пример #1
0
        public static void InitProblemGridWithOCR()
        {
            ProblemSudokuGrid = new int[9, 9];
            NewPuzzle         = SudokuPuzzle.Create(3, 3, 30);
            NewPuzzle.GetNodes().ToList().ForEach(Node =>
            {
                if (Node.Value == -1)
                {
                    ProblemSudokuGrid[Node.Line, Node.Column] = 0;
                }
                else
                {
                    ProblemSudokuGrid[Node.Line, Node.Column] = Node.Value;
                }
            });

            ProblemGrid = new ASudokuGrid(ProblemSudokuGrid);
            Console.WriteLine("Press any key to have GA solve this grid.");
            PrintGrid(GridToString(ProblemGrid.Grid));
            Console.ReadKey();
        }