Beispiel #1
0
        public void answerTest(Char c)
        {
            try
            {
                if (game.getlistEchec().Contains(c) == true)
                {
                    MessageBox.Show("Vous avez deja tester cette lettre");
                    return;
                }

                if (printWord.testLetter(hide_Word.getSecretArray(), c) == false)
                {
                    game.addEchec(c);
                    repaint();
                }
                Affiche.Text  = printWord.getWord();
                lb_Echec.Text = game.getEchecList();
                if (printWord.testWord(hide_Word.getSecretArray()) == true)
                {
                    MessageBox.Show("Vous avez gagner!");
                    game = new Partie();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Erreur: " + e.Message);
            }
        }
Beispiel #2
0
 public void initializeGame()
 {
     game                 = new Partie();
     printWord            = new printWord(hideWord);
     hide_Word            = new FindAWord(hideWord);
     img1.BackgroundImage = null;
     Affiche.Text         = printWord.getWord();
     lb_Echec.Text        = game.getEchecList();
 }