%Rule 90, based on exclusive or on left and right cells

T=3000;
n=3000;

x=zeros(T,n);
x(1,T/2)=1;

for t=1:T
    %Apply rule to all the 'interior' cells
    for i=2:n-1
        x(t+1,i)=xor(x(t,i-1),x(t,i+1));
    end
    %Apply to boundary
    x(t+1,1)=xor(x(t,n),x(t,2));
    x(t+1,n)=xor(x(t,1),x(t,n-1));
end

%Plot and change coloring to black and white
imagesc(x)
colormap([[1:-1/63:0]' [1:-1/63:0]' [1:-1/63:0]'])
