An efficient algorithm for generating symmetric ice piles