public CrossSumsMatrix(CrossSumsForm form) : base(form) { debugLog = CrossSumsForm.debugLog; bool solvablePuzzleCreated = false; while (!solvablePuzzleCreated) // change "if" to "while" to retry indefinitely. { Initialize(); try { solvablePuzzleCreated = CreateThePuzzle(); if (solvablePuzzleCreated) { foreach (OpenCell cell in openCells) { cell.Text = "0"; } } } catch (Exception e) { debugLog.Write("\n\n\nSomething Really Bad Happened!\n\n\n"); debugLog.Write(e.Message); } } debugLog.Write("\nAll done!\n"); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CrossSumsForm crossSumsForm = new CrossSumsForm(); Application.Run(crossSumsForm); }
public void DrawYourself(CrossSumsForm form) { if ((rowSum == 0) && (columnSum == 0)) { form.DrawBlackBox(this); } else { form.DrawSumsCell(this, rowSum, columnSum); } }
public void DrawYourself(CrossSumsForm form) { form.AddOpenCell(this); }
public CrossSumsGraphics(CrossSumsForm form) { this.form = form; }
public DebugLog(CrossSumsForm form_) { form = form_; }