m = 40;
n = 40;
ca = zeros ( m, n );

for k = 0 : 40

  if ( k == 0 )
    ca(m,floor(n/2)) = 1;
  else
    ca(1:m-1,:) = ca(2:m,:);
    ca(m,:) = ca_step ( ca(m-1,:) );
  end
  
  clf
  hold on
  for i = 1 : m
    for j = 1 : n
      a = j - 1;
      b = j;
      c = m - i + 1;
      d = m - i;
      if ( ca(i,j) == 0 )
        color = 'w';
      else
        color = 'r';
      end
      fill ( [ a, b, b, a ], [ c, c, d, d ], color );
    end
  end
  hold off

  axis equal
  axis off

  pause

end
