void Save() { if (genomeassigned && genomechanged) { maxgenome.SaveGenome(genomefile); SudokuLoad.SaveScore(scorefile, maxgenome.ID, maxscore); genomechanged = false; } }
public MainForm() { InitializeComponent(); if (SudokuLoad.ParseSudoku(sudokufile, out WholeGrid grid)) { currentpuzzle = grid; ogInput = currentpuzzle.NormaliseCurrentValues(); puzzleassigned = true; } else { MessageBox.Show("Puzzle not parsed."); } bool g = Genome.ParseGenome(genomefile, out Genome ge); bool s = SudokuLoad.LoadScore(scorefile, out int id, out double score); if (g && s) { if (ge.ID == id) { maxgenome = ge; prevcommon = maxgenome; maxscore = score; genomeassigned = true; Console.WriteLine("Successfully parsed."); } else { MessageBox.Show("Didn't parse properly. 1"); } } else { MessageBox.Show("Didn't parse properly. 2"); } }