예제 #1
0
 private static void DisplayGuessResult(MasterMindBll masterMindBll, string guess)
 {
     if (masterMindBll.IsCorrectGuess(guess))
     {
         Console.WriteLine($"Correct! {guess} was the answer!");
     }
     else
     {
         Console.WriteLine($"{masterMindBll.GuessResult(guess)}");
     }
 }
예제 #2
0
        private static void PlayAnotherRound(MasterMindBll masterMindBll)
        {
            Console.WriteLine();
            Console.WriteLine("Please enter your guess below.");
            string guess = Console.ReadLine();

            while (!masterMindBll.IsValidGuess(guess))
            {
                guess = PromptForNewGuess(masterMindBll, guess);
            }

            DisplayGuessResult(masterMindBll, guess);

            if (!masterMindBll.AnotherGuessAllowed && !masterMindBll.IsCorrectGuess(guess))
            {
                Console.WriteLine($"Sorry, but that was your final guess and it was incorrect.");
            }
        }