Exemple #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);
        }
Exemple #2
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);
        }