function jedanodosam(n,iter)
% jedanodosam(100,100)
A=zeros(n);
A(n/2,n/2)=1;


for i=1:iter
    B=A;
    for j=2:n-1
        for k=2:n-1
            brojjedinica=sum([A(j-1,k-1:k+1),A(j,[k-1,k+1]),A(j+1,k-1:k+1)]);
            if brojjedinica==1
                B(j,k)=1;
            else
                B(j,k)=A(j,k);
            end
        end
    end
    A=B;
    spy(A);
    pause
end
                
              
            