Beispiel #1
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            errorCheck();

            if (radConundrum.Checked == true)
            {
                frmConundrum conundrum = new frmConundrum(playerName);
                conundrum.Show();
                this.Hide();
            }

            if (radGuesstheWord.Checked == true)
            {
                frmGuesstheWord guess = new frmGuesstheWord(playerName);
                guess.Show();
                this.Hide();
            }

            if (radUpdateWords.Checked == true)
            {
                frmAdminLogin admin = new frmAdminLogin(playerName);
                admin.Show();
                this.Hide();
            }
        }
        private void btnEnter_Click(object sender, EventArgs e)
        {
            errorCheck();

            if(radConundrum.Checked == true)
            {
                frmConundrum conundrum = new frmConundrum(playerName);
                conundrum.Show();
                this.Hide();
            }

            if (radGuesstheWord.Checked == true)
            {
                frmGuesstheWord guess = new frmGuesstheWord(playerName);
                guess.Show();
                this.Hide();
            }

            if (radUpdateWords.Checked == true)
            {
                frmAdminLogin admin = new frmAdminLogin(playerName);
                admin.Show();
                this.Hide();
            }
        }
        public void setNewWord()
        {
            if (guess == words.ElementAt(indexNum))
            {
                MessageBox.Show("Correct");
                indexNum++;
                txtGuess.Text = "";
                score++;
                lblWord.Text = "";

                #region
                if (indexNum == words.LongLength -1)
                {
                    var userChoice = MessageBox.Show("You have completed Conundrum\nThere are no more words", "Congratulations", MessageBoxButtons.OK);

                    if (userChoice == DialogResult.OK)
                    {
                        var exitOption = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nYou will be returned to the menu", "Congratulations", MessageBoxButtons.OK);

                        if (exitOption == DialogResult.OK)
                        {
                            frmGuesstheWord gtw = new frmGuesstheWord(playerName);
                            gtw.Show();
                            this.Hide();
                        }
                    }
                }
                #endregion
                else
                {
                    hiddenWord = words.ElementAt(indexNum);
                    writeNewWord(hiddenWord);
                    lblScore.Text = score.ToString();
                }
            }
            else
            {
                MessageBox.Show("Incorrect");
                txtGuess.Text = "";
                numGuess--;
                lblNumGuess.Text = numGuess.ToString();
            }
        }
Beispiel #4
0
        public void setNewWord()
        {
            if (guess == words.ElementAt(indexNum))
            {
                MessageBox.Show("Correct");
                indexNum++;
                txtGuess.Text = "";
                score++;
                lblWord.Text = "";

                #region
                if (indexNum == words.LongLength - 1)
                {
                    var userChoice = MessageBox.Show("You have completed Conundrum\nThere are no more words", "Congratulations", MessageBoxButtons.OK);

                    if (userChoice == DialogResult.OK)
                    {
                        var exitOption = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nYou will be returned to the menu", "Congratulations", MessageBoxButtons.OK);

                        if (exitOption == DialogResult.OK)
                        {
                            frmGuesstheWord gtw = new frmGuesstheWord(playerName);
                            gtw.Show();
                            this.Hide();
                        }
                    }
                }
                #endregion
                else
                {
                    hiddenWord = words.ElementAt(indexNum);
                    writeNewWord(hiddenWord);
                    lblScore.Text = score.ToString();
                }
            }
            else
            {
                MessageBox.Show("Incorrect");
                txtGuess.Text = "";
                numGuess--;
                lblNumGuess.Text = numGuess.ToString();
            }
        }