Langton's ant: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
imported>Maxima enthusiast
No edit summary
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(3 intermediate revisions by one other user not shown)
Line 2,269:
=={{header|EasyLang}}==
 
[https://easylang.dev/show/#cod=bZHLDoIwEEX3/Yq7VAlNa0wMifgjhIXhEUiUmopA/94ZKILBJn3k9M70zvReNCiTFFopHHgVT2syvCrTQ0IKAKWxcIih0BpEESNPhw2lUZeU0E3JEJAmgE5JqBcJjYfpCrpzP9AWWQu9Vkqx2qWQkzv7bjgWeW1nk/mQ8CMJ+dE0Q410xM7jUPubEfdVfefnr+z/1uR0vIx++ewW7CbsTXSUaVva3I+/NSNE5wVsNsaOtwBH0nZ76kKOE4u9hgJjLoVEc143IvdF3ASu/6xwUlCCf0p8AA== Run it]
[https://easylang.online/apps/_langtons-ant.html Run it]
 
<syntaxhighlight lang="text">
len f[] 100 * 100
proc show . .
for y = 0 to 99
for x = 0 to 99
if f[y * 100 + x + 1] = 1
move x y
rect 1 1
.
.
.
.
.
proc run x y dir . .
dx[] = [ 0 1 0 -1 ]
dy[] = [ -1 0 1 0 ]
while x >= 0 and x < 100 and y >= 0 and y < 100
v = f[y * 100 + x + 1]
f[y * 100 + x + 1] = 1 - v
dir = (dir + 2 * v) mod 4 + 1
x += dx[dir]
y += dy[dir]
.
.
call run 70 40 0
call show
</syntaxhighlight>
 
Line 9,310:
{{trans|D}}
The textual version only.
<syntaxhighlight lang="ecmascriptwren">var width = 75
var height = 52
var maxSteps = 12000
9,476

edits