Example #1
0
 internal static FillPuzzle Load(string fileName)
 {
     string[] lines = File.ReadAllLines(fileName);
     string[] bits = lines[0].Split('x');
     int width = int.Parse(bits[0]);
     int height = int.Parse(bits[1]);
     FillPuzzle res = new FillPuzzle(width, height);
     for (int i = 0; i < height; i++)
     {
         for (int j = 0; j < width; j++)
         {
             if (lines[i + 1][j] != ' ')
             {
                 res.Clues[j, i] = int.Parse(""+lines[i + 1][j]);
             }
         }
     }
     return res;
 }
Example #2
0
 public object Clone()
 {
     FillPuzzle newPuzzle = new FillPuzzle(width, height);
     for (int i = 0; i < width; i++)
     {
         for (int j = 0; j < height; j++)
         {
             newPuzzle.Clues[i, j] = this.Clues[i, j];
         }
     }
     return newPuzzle;
 }