Jump to content

Langton's ant: Difference between revisions

m
No edit summary
Line 4,315:
Document Doc$
for i=1 to N:for j=1 to N
Doc$=if$(rect(i,j,i)=White->"_","#")
next
Doc$={
Line 4,331:
<pre style="height:30ex;overflow:scroll">
____________________________________________________________________________________________________
__________________________________________________________________##________________________________
______________________________________##__############__##__________________________________________
___________________________________________________________________##_______________________________
_____________________________________##__#__________####__#_________________________________________
____________________________________________##__##____________###_##_#______________________________
____________________________________#_##____________##___###________________________________________
___________________________________________#__##__###________####_#__#______________________________
____________________________________#____#__#_________#__#_#________________________________________
__________________________________________#____##___#______##_##__#_#_______________________________
__________________________________#_______###_________#_#_##__##____________________________________
_______________________________________##_#_____#_____#######_###_##________________________________
__________________________________###__##_##_____#_____#___#__#_###_________________________________
______________________________________#__#__#___##_#___#__#####_#__#________________________________
______________________________##__##_#__#_#___##_####_##__###__#_#__________________________________
_____________________________________###___#___####__##_###_#______##_______________________________
_____________________________###___###_____#_#_###__##_#__##_###_#__________________________________
______________________________________________________________#_#_#_#__##___#__#___#_##__#_###_#####___#_____#_________________________________________________________________
_________________________________#__#___#____#_____##__##___#_#_#####_#_____________________________
____________________________#___#_###_#_######_##_##__####_#___##_###_______________________________
_____________________________##_________________________________###_##__#__#____#___#_##_##_##_#_#_#____#_#_###_#____________________________________________________________
________________________________##_____##_###___##_###___##_####__#__#______________________________
___________________________##_#____####__#_#___#___###_##_#___#_#___________________________________
__________________________________###__###_#___#_#_###_____#__#____##_______________________________
__________________________##_____#_##_____##__#___##_##_________#__#________________________________
____________________________________#_#___#########_#####___####____________________________________
_________________________#_##__##_###___#_____##__#__###_##_#_#___###_______________________________
______________________________###_###__##_#__#______#___##__#_______________________________________
_________________________#___####_##__#____#__###___##_##___##__###__#______________________________
_______________________________#####_#####__##___#####____#_#_#_____________________________________
__________________________#_____#__###_##_#__##_####_#_#__#_#___#___###_____________________________
____________________________________________________##__#___#_##_###______#__#_###_#__#____####_#__###__#_____________________________#_###_____________________________________
___________________________#____##__##___###__#__#__#__#___#_#______________________________________
_______________________#___##_####__####_#####__##__##_#_##_#_____#___###___________________________
__________________________###______###__#_##_##____#__#_##_#________________________________________
______________________#___#____#_#_#___##______##_#_#_###_#__#_#_#__###__#__________________________
__________________________#_#__#____#____#_#####__#____#_##_________________________________________
______________________#______#___####_####_______##___#_##__###_##__#___###_________________________
_______________________________##_###__#_#__##_##____#__#_#_________________________________________
_______________________#____#____#__####__#_###########__##___#__#_#__###__#________________________
___________________________#_#_____#_#_____#_#_##_#_#__###_##_#_____________________________________
_______________________##__#____##__#__#########__##__####_#______##__#___###_______________________
________________________________________________#____###__#__#__#_#__#___###_###_##_##___##_#__##___#_#__###__#___________________________________________________________
__________________________#___##_###_##_#__#___#_____####_#_##______________________________________
______________________#___##___###_###____#_#_##_#_##_######_#__#___##__#___###_____________________
__________________________#__##___###______#__####_###_##___##______________________________________
_______________________#___##____#_##__#_#_____#####_#_#####_____#___#_#__###__#____________________
__________________________#______###_____###__###___##__#____#______________________________________
_______________________#__#__#_##__#__#___#_#__##_#####_##_#_____#____##__#___###___________________
__________________________#_____#_#_#_####____####__##_##___________________________________________
_______________________##___##########___##_#####__#_####___#____#_____#_#__###__#__________________
_____________________________________________________#_____##_####_##___#___##_##___#__#___##___##_#______##__#___#_##______________________________________________________
__________________________#______#_#____#####_#_#_###_______###_____________________________________
_________________________#_#__#__#__#_#____#___#_##___##__#_#####________#_#__###__#________________
__________________________#____####_#____###_##_###___#_#____#______________________________________
_________________________##__##__#__##_#_#_##_##____#_#_#_##__##__________##__#___###_______________
_________________________#_##__________________________#_____#__##_#_#_##_####__##_#____#__#_________________#_#__###__#_____________________________________________________
__________________________#_____#_##_##__#____#######_______________________________________________
_________________________#_##__#__#___##_##_______#___#__#__________________##__#___###_____________
__________________________###___##__##__#_###_#_##_#___#____________________________________________
_________________________####_##___##__##__#______#__#__#____________________#_#__###__#____________
__________________________###____##_######_#__#___####____#_________________________________________
________________________###_#___#____##__##_______#___##______________________##__#___###___________
________________________#___________________________#_##_###_##__##____####__#_#_#____________________________#_#__###___#__________________________________________________
___________________________#___#######_######__#_##_#_#____#________________________________________
_______________________#__#_#_##_#__##____####__##______________________________##__#___###_________
__________________________#___#___##_#__#___##_######__#__#_________________________________________
______________________#####_##_###_##____##____##________________________________#_#__###__#________
__________________________#_##____###__#___#_#######_#__##__________________________________________
______________________####__#_##_#________________________________________________##__#___###_______
___________________________##_#_##___#_#_#_##_#__##__###____________________________________________
______________________##_##_##_____________________________________________________#_#__###__#______
____________________________##______________________________________________________##__#___#_##_______________#####___#____________________________________________
________________________________#___#__#####_#______#_#_____________________________________________
____________________#_####__##_#_____________________________________________________#_#__###__#____
_________________________________##_____#_#_##___#____#_____________________________________________
____________________###__###_#__#_____________________________________________________##__#___###___
______________________________##_#__##_#_____##_#____###____________________________________________
_____________________#__#__#_##_#______________________________________________________#_#__###__#__
______________________________#_##_#______#_#___#____###____________________________________________
______________________##______##________________________________________________________##__#___###_
_______________________________#___####_##___#___#____#_____________________________________________
_____________________________##__________________________________________________________#_#__###__#
_______________________________###__#___#___###___####______________________________________________
__________________________________________________________________________________________##__#_###_
_______________________________#___##__##_##___#____________________________________________________
___________________________________________________________________________________________#_#_#_#_#
__________________________________##__##__#___###___________________________________________________
____________________________________________________________________________________________##_####_
___________________________________##__#_##_##___#__________________________________________________
_____________________________________________________________________________________________#_##_#_
________________________________________##__#___###_________________________________________________
______________________________________________________________________________________________####__
_________________________________________#_##_##___#________________________________________________
_______________________________________________________________________________________________##___
__________________________________________##__#___###_______________________________________________
____________________________________________________________________________________________________
___________________________________________#_##_##___#______________________________________________
____________________________________________##__#___###_____________________________________________
_____________________________________________#_##_##___#____________________________________________
______________________________________________##__#___###___________________________________________
_______________________________________________#_##_##___#__________________________________________
________________________________________________##__#___###_________________________________________
_________________________________________________#_##_##___#________________________________________
__________________________________________________##__#___###_______________________________________
___________________________________________________#_##_##___#______________________________________
____________________________________________________##__#___###_____________________________________
_____________________________________________________#_##_##___#____________________________________
______________________________________________________##__#___###___________________________________
_______________________________________________________#_##_##___#__________________________________
________________________________________________________##__#___###_________________________________
_________________________________________________________#_##_##___#________________________________
__________________________________________________________##__#___###_______________________________
___________________________________________________________#_##_##___#______________________________
____________________________________________________________##__#___###_____________________________
_____________________________________________________________#_##_##___#____________________________
______________________________________________________________##__#___###___________________________
_______________________________________________________________#_##_##___#__________________________
________________________________________________________________##__#___###_________________________
_________________________________________________________________#_##_##___#________________________
__________________________________________________________________##__#_#####_______________________
___________________________________________________________________#_###_####_______________________
____________________________________________________________________##_###_#________________________
_____________________________________________________________________#_#_##_________________________
______________________________________________________________________#_#___________________________
 
</pre >
 
=={{header|MATLAB}} / {{header|Octave}}==
<lang MATLAB>function u = langton_ant(n)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.