コード例 #1
0
ファイル: Program.cs プロジェクト: MohaymenSameen/Programming
        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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: 24628/c-sharp-assignments
        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());
        }