Esempio n. 1
0
        private void GameBoard_Load(object sender, EventArgs e)
        {
            label_wrongGuessedLetters.Text = "";
            gameSession = new GameSession();
            label_AlreadyGuessed.Text    = "";
            label_AlreadyGuessed.Visible = false;

            List <string> wordForHangman = gameSession.AddGameWords();
            Random        rnd            = new Random();
            int           gameWordIndex  = rnd.Next(wordForHangman.Count);

            string gameWord = wordForHangman[gameWordIndex];

            GameWord = gameWord;
            for (int i = 0; i < gameWord.Length; i++)
            {
                label_MaskedWord.Text += "*";
            }

            label_MaskedWord.Font = new Font("Arial", 12);
        }