2

So I am new to code and c# and for my first app I have made a basic Console Number Guessing game.

Now currently my range for a user to input is between 1-100 which makes it quite difficult for player two to guess this number so I wanted to add some code that allowed for a clue if the user was close or far away (hot and cold)

Below I will attach my main method, the methods are just returning a number and currently for test purposes I have stored them in a and b

the range statement lower down is what I have tried from looking at others solutions but I think I am just confusing myself. Any explanation would be super helpful and this is my first time using stack so if I am doing something wrong in this post alos

        public static void Main(string[] args)
    {

        var attemps = 0;



        Opening();
        int a = numberProvider();
        whitespace();
        Nextplayer();
        int b = numberguess();

        while (a != b)
        {
            attemps++;
            Console.WriteLine("Incorrect please try again you have had " + attemps + " attempts");

            if (Enumerable.Range(a, 30).Contains(b))
            {
                Console.WriteLine("You are warm");
            }

            string test = Console.ReadLine();
            b = Convert.ToInt32(test);

        }
Joey
  • 29
  • 1

0 Answers0