コード例 #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;
            }
        }
コード例 #2
0
 public void GameWon()
 {
     SetScore();
     view.Show("Game Completed in: " + game.timeTaken + " seconds, Your score was:" + game.GetScore());
     view.Show("Moves:" + game.moves.Count + "TimeTaken:" + game.timeTaken);
     StopTimer();
 }