public void moveDiscs(int n, HanoiTower destination, HanoiTower buffer) { if (n > 0) { moveDiscs(n - 1, buffer, destination); MoveTopTo(destination); buffer.moveDiscs(n - 1, destination, this); } }
public void MoveTopTo(HanoiTower tower) { int top = discs.Pop(); tower.Add(top); }