예제 #1
0
        public static int MakeGuess(HighLow game)
        {
            int guessedNumber = GetHalfwayNumber(game);

            Console.WriteLine($"My guess is {guessedNumber}");
            game.Guesses++;

            return(guessedNumber);
        }
예제 #2
0
        public static int MakeGuess(HighLow game)
        {
            int guessedNumber = game.GetRandomNumberBetweenBounds();

            Console.WriteLine($"My guess is {guessedNumber}");
            game.Guesses++;

            return(guessedNumber);
        }
예제 #3
0
 private static int GetHalfwayNumber(HighLow game)
 {
     return((game.MaxNumber - game.MinNumber) / 2 + game.MinNumber);
 }