void AutoGenerate() { string folder = @"C:\Users\savag\OneDrive\Documents\Sudoku\Auto"; int n = 0; while (!stopped) { //g.Generate(new HintSelections(HintSelections.Level.Extreme)); grid.Generate(null); HintSelections.Level?level; SolveResult solns; grid.RateDifficulty(out level, out solns); string difficulty = (level == null) ? "Impossible" : level.ToString(); string[] lines = grid.GridStrings(); string fileName = desc + " " + difficulty + " " + (n++) + ".sud"; File.WriteAllLines(Path.Combine(folder, fileName), lines); } finished.Set(); }