Ejemplo n.º 1
0
        void Start()
        {
            HangmanGame   hangman = new HangmanGame();
            List <string> words   = ListOfWords();

            hangman.Init(SelectWord(words));
            bool win = PlayHangman(hangman);

            Console.WriteLine();
            if (win)
            {
                Console.WriteLine("You have guessed the word!!!");
            }
            else
            {
                Console.WriteLine("You lost");
            }
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        bool Start()
        {
            HangmanGame   hangman = new HangmanGame();
            List <string> words   = new List <string>();

            words = ListOfWords();
            string secretWord = SelectWord(words);

            hangman.Init(secretWord);
            if (PlayHangman(hangman))
            {
                Console.WriteLine("You guessed the word!");
            }
            else
            {
                Console.WriteLine("You didn't guess the word...");
                Console.WriteLine($"The secret word was: {hangman.secretWord}");
            }

            return(ProgramTools.LoopGame());
        }