Пример #1
0
        private void MoveTopTo(HanoiTower destination)
        {
            int pop = _disks.Pop();

            destination.Add(pop);
            Trace.TraceInformation("Move disk {0} from {1} to {2}", pop, Name, destination.Name);
        }
Пример #2
0
 public void MoveDisks(int disk, HanoiTower destination, HanoiTower buffer)
 {
     if (disk <= 0)
     {
         return;
     }
     MoveDisks(disk - 1, buffer, destination);
     MoveTopTo(destination);
     buffer.MoveDisks(disk - 1, destination, this);
 }