Langton's ant: Difference between revisions
Content added Content deleted
(Added solution for Action!) |
|||
Line 2,132: | Line 2,132: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
[https://easylang.online/ide/?run=len%20f%5B%5D%20100%2A100%0Afunc%20show%20.%20.%0Afor%20y%20range%20100%0Afor%20x%20range%20100%0Aif%20f%5By%2A100%2Bx%5D%3D1% |
[https://easylang.online/ide/?run=len%20f%5B%5D%20100%2A100%0Afunc%20show%20.%20.%0Afor%20y%20range%20100%0Afor%20x%20range%20100%0Aif%20f%5By%2A100%2Bx%5D%3D1%0Amove%20x%20y%0Arect%201%201%0A.%0A.%0A.%0A.%0Afunc%20run%20x%20y%20dir%20.%20.%0Adx%5B%5D%3D%5B%200%201%200%20-1%20%5D%0Ady%5B%5D%3D%5B%20-1%200%201%200%20%5D%0Awhile%20x%20%3E%3D%200%20and%20x%20%3C%20100%20and%20y%20%3E%3D%200%20and%20y%20%3C%20100%0Av%3Df%5By%2A100%2Bx%5D%0Af%5By%2A100%2Bx%5D%3D1%20-%20v%0Adir%3D%28dir%2B1%2B2%2Av%29%20mod%204%0Ax%2B%3Ddx%5Bdir%5D%0Ay%2B%3Ddy%5Bdir%5D%0A.%0A.%0Acall%20run%2070%2040%200%0Acall%20show Run it] |
||
<lang>len f[] 100 * 100 |
<lang>len f[] 100 * 100 |
||
Line 2,139: | Line 2,139: | ||
for x range 100 |
for x range 100 |
||
if f[y * 100 + x] = 1 |
if f[y * 100 + x] = 1 |
||
move x y |
|||
rect 1 1 |
|||
. |
. |
||
. |
. |