예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter 1 for factorial or 2 for Tower of Hanoi");
            string userInput = Console.ReadLine();

            if (userInput == "1")
            {
                Factorial factorial = new Factorial();
            }
            else
            {
                //Do Tower of Hanoi
                TowerOfHanoi towerOfHanoi = new TowerOfHanoi();
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter 1 for factorial or 2 for Tower of Hanoi");
            string userInput = Console.ReadLine();

            if (userInput == "1")
            {
                //The Dawn way(work done in constructor)
                Factorial factorial = new Factorial();
            }
            else
            {
                //DO towers of Hanoi
                //The Dawn way(work done in constructor)
                TowerOfHanoi towerOfHanoi = new TowerOfHanoi();
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter 1 for Factorial or 2 for Tower Of Hanoi");
            string userInput = Console.ReadLine();

            if (userInput == "1")
            {
                //Do Factorial
                //The Dawn Way
                Factorial factorial = new Factorial();
            }
            else
            {
                //Do Tower Of Hanoi
                //The Dawn way AGAIN
                TowerOfHanoi towerOfHanoi = new TowerOfHanoi();
            }
        }