コード例 #1
0
        public static void ReadPuzzle(int selectedPuzzle, SudokuBoard board)
        {
            string fileName = "";

            try
            {
                fileName = Directory.GetCurrentDirectory() + "\\Puzzles\\puzzle" + selectedPuzzle + ".txt";
                string[] lines = File.ReadAllLines(fileName);
                foreach (string line in lines)
                {
                    board.AddRow(line);
                }
            }
            catch (Exception e)
            {
                Console.Write("There was a problem reading the puzzle file.\n{0}", e.Message);
            }
        }