Example #1
0
        private void IsPuzzleFinished()
        {
            if (game.IsPuzzleValid())
            {
                hintOutput.Text = "Complete. with a score of " + game.GetScore() + " and in a time of " + game.timeTaken + " seconds. The highscore for this game is " + game.highScore;
                game.SetHighScore();
                game.StopTimer();

                foreach (Control ctrl in sudokuPanel.Controls)
                {
                    if ((ctrl as TextBox) != null)
                    {
                        (ctrl as TextBox).Enabled = false;
                    }
                }
            }
            else if (Array.Exists(game.numbersArray, element => element == 0) != true)
            {
                int wrongNum = game.NumberOfIncorrectSquares();
                numWrong.Text    = wrongNum.ToString() + " cell/s are still incorrect";
                numWrong.Visible = true;
            }
        }