Beispiel #1
0
        static void Main(string[] args)
        {
            TowerOfHanoi T = new TowerOfHanoi();

            Console.Write("Enter the number of discs: ");
            string cnumdiscs = Console.ReadLine();

            TowerOfHanoi.numdiscs = Convert.ToInt32(cnumdiscs);
            T.initializeTowers();
            T.MoveTower(TowerOfHanoi.numdiscs, 1, 3, 2);
        }
        static void Main()
        {
            TowerOfHanoi T = new TowerOfHanoi();
            string       cnumdiscs;

            Console.Write("Enter the number of discs: ");
            cnumdiscs  = Console.ReadLine();
            T.numdiscs = Convert.ToInt32(cnumdiscs);
            T.moveTower(T.numdiscs, 1, 2, 3);
            Console.ReadLine();
        }
Beispiel #3
0
        public static int Main()
        {
            TowerOfHanoi Tower = new TowerOfHanoi();
            string       userNumDiscs;

            Console.Write("Enter the number of discs you wish to play with: ");
            userNumDiscs   = Console.ReadLine();
            Tower.Numdiscs = Convert.ToInt32(userNumDiscs);

            Tower.MoveTower(Tower.Numdiscs, 1, 3, 2);
            Console.ReadLine();

            return(0);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            TowerOfHanoi ToH = new TowerOfHanoi();

            //Console.WriteLine("Solve 5!: " + ToH.RecursiveFactorial(5) + Environment.NewLine + "Press any key to continue...");
        }