Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Langtons-ant/Octave/langtons-ant.octave
Normal file
11
Task/Langtons-ant/Octave/langtons-ant.octave
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
clear
|
||||
E=100 % Size of lattice.
|
||||
N=11200 % Number of iterations.
|
||||
z(1:1:E^2)=-1; % Init lattice rotations (-1=right, 1=left)
|
||||
k(1:1:E^2)=0;
|
||||
k(1)=(E^2+E)/2; % Init the Ant @ 50,50
|
||||
for t=1:1:N;
|
||||
k(t+1)=mod(k(t)+real(round((0.5*(E+1)*exp(i*pi/4*(trace(diag(z))-E^2)))-(0.5*(E-1)*exp(-i*pi/4*(trace(diag(z))-E^2)))))+imag(round((0.5*(E+1)*exp(i*pi/4*(trace(diag(z))-E^2)))-(0.5*(E-1)*exp(-i*pi/4*(trace(diag(z))-E^2))))),E^2);
|
||||
z(k(t+1)+1)=real(exp(2*i*pi/4*(1+z(k(t+1)+1))));
|
||||
endfor;
|
||||
imagesc(reshape(z,E,E)) % Draw the Lattice
|
||||
Loading…
Add table
Add a link
Reference in a new issue