コード例 #1
0
ファイル: DiskManager.cs プロジェクト: cesaroll/Coding
        public DiskManager(int diskCount)
        {
            Origin      = new Tower("Origin");
            Buffer      = new Tower("Buffer");
            Destination = new Tower("Destination");

            //Add Disks in Origin Stack from bigger to lower
            for (int i = diskCount; i > 0; i--)
            {
                Origin.Push(i);
            }
        }
コード例 #2
0
 public void MoveTo(Tower other)
 {
     other.Push(this.Pop());
 }