예제 #1
0
        private void btnDisplayAnswers_Click(object sender, EventArgs e)
        {
            bool isBoardDisplayed = game.IsDisplayed();

            if (!isBoardDisplayed)
            {
                game.DisplayEmptyHoles();
                game.SetDisplayed(true);
                isBoardDisplayed = game.IsDisplayed();

                btnDisplayAnswers.Text = "Hide";
            }
            else if (isBoardDisplayed)
            {
                game.Hide();
                game.SetDisplayed(false);
                isBoardDisplayed = game.IsDisplayed();

                btnDisplayAnswers.Text = "Display";
            }
        }
예제 #2
0
        public GameForm()
        {
            InitializeComponent();

            game = new Sudoku(this, board, Difficulty.Easy);
            game.Hide();

            StartPosition = FormStartPosition.CenterScreen;

            btnDisplayAnswers.Text = "Display";

            int hiddenCount = game.GetBoard().CountHidden();

            lblHiddenCount.Text = $"Hidden: {hiddenCount.ToString()}";

            AddComboBoxItems();
            cmbDifficulties.SelectedIndex = 0;

            MaximizeBox     = false;
            FormBorderStyle = FormBorderStyle.FixedSingle;
        }