Beispiel #1
0
        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");
        }
Beispiel #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            CrossSumsForm crossSumsForm = new CrossSumsForm();

            Application.Run(crossSumsForm);
        }
Beispiel #3
0
 public void DrawYourself(CrossSumsForm form)
 {
     if ((rowSum == 0) && (columnSum == 0))
     {
         form.DrawBlackBox(this);
     }
     else
     {
         form.DrawSumsCell(this, rowSum, columnSum);
     }
 }
Beispiel #4
0
 public void DrawYourself(CrossSumsForm form)
 {
     form.AddOpenCell(this);
 }
Beispiel #5
0
 public CrossSumsGraphics(CrossSumsForm form)
 {
     this.form = form;
 }
Beispiel #6
0
 public DebugLog(CrossSumsForm form_)
 {
     form = form_;
 }