use strict; use ca; use cell; use warnings; $sandHeap = ca->new(5,1,20,'0.0','0','0.0'); while($sandHeap->{iniTime}++ <= $sandHeap->{finTime}) { my $rndCell = $sandHeap->getRandomCell(); $rndCell->increaseCellValue(); print $sandHeap->toString(); while($sandHeap->isInstable()){ $sandHeap->doTransition(); print $sandHeap->toString(); } }