コード例 #1
0
 public SudokuTable(string Url) : this()
 {
     if (Url != string.Empty)
     {
         FileReaderWorker reader = new FileReaderWorker();
         reader.InitializeFromFile(this, Url);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: michalgruda1/SudokuSolver
        static void Main(string[] args)
        {
            string      Url       = "../../../hardToDFS_sudoku.txt";
            SudokuTable newSudoku = new SudokuTable();

            FileReaderWorker fileWorker = new FileReaderWorker();

            fileWorker.InitializeFromFile(newSudoku, Url);

            Console.WriteLine("Sudoku table from file:");
            Console.WriteLine(newSudoku.ToString());

            if (newSudoku.Solve(10))
            {
                Console.WriteLine("Solved sudoku:");
                Console.WriteLine(newSudoku.ToString());
            }
            else
            {
                Console.WriteLine("Could not solve sudoku");
            }
            Console.ReadLine();
        }