Example #1
0
    public static void Main()
    {
        NumberGame myNumber = new NumberGame();

        myNumber.InitializeGame();
        Console.WriteLine("Would you like to play the higher/lower game? (yes/no)");
        string input = Console.ReadLine();

        if (input == "yes")
        {
            Console.WriteLine("Okay!");
        }
        else
        {
            Console.WriteLine("GoodBye");
        }
        Console.WriteLine("Is your number higher or lower than " + myNumber.newNumber + "? (higher/lower/correct)");
        string answer = Console.ReadLine();

        myNumber.NumberFinder(answer);
        if (answer == "correct")
        {
            Console.WriteLine("Correct answer!");
        }
        else
        {
            while (answer != "correct")
            {
                Console.WriteLine("Is your number higher or lower than " + myNumber.newNumber + "? (higher/lower/correct)");
                answer = Console.ReadLine();
                myNumber.NumberFinder(answer);
            }
        }
    }