% sand_piles % C Bishop % We have a grid on a n by n torus and place a % random number of grains of sand on each loation. % if there are four or more grains at one place, % four are moved, one each, to each of the neighboring % sites: up, down, left right. close all; num=20;top=6; delay=0;skip=1;limit=1000; old=randi(3,num); % uniform 1,2,3 %old=randi(4,num); % uniform 1,2,3,4 p=.1; %old= 3 *ones(num) + (rand(num)