Пример #1
0
        public void TestWordGetRandomWord()
        {
            string[] words = new string[] { "hest", "pave", "farm", "buks" };
            string   word  = logic.GetRandomWord(words);

            Assert.Contains(word, words);
        }
Пример #2
0
        public void StartGame()
        {
            Console.BackgroundColor = ConsoleColor.White;
            Console.ForegroundColor = ConsoleColor.Black;
            Console.WriteLine("Welcome to Word Guesser <beta version>");
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.White;
            string input = "";

            do
            {
                string word = wordLogic.GetRandomWord(words);
                playRound(word);
                Console.WriteLine("\nType 'q' to quit or press 'Enter' to play");
                input = Console.ReadLine()?.ToLower();
                Console.Clear();
            } while (!input.StartsWith("q"));
        }