Langton's ant: Difference between revisions
→{{header|Tcl}}
(→{{header|Haskell}}: simplify let's in nextState) |
|||
Line 1,951:
....................................................................................................</pre>
=={{header|
<lang Runbasic>
'move up=1 right=2 down=3 left=4
' ---------------------------------
dim plane(100,100)
x = 50: y = 50
mx = 100
while (x>0) and (x<100) and (y>0) and (y<100)
if plane(x,y) then
nxt = nxt - 1
if nxt < 1 then nxt = 4
else
nxt
if nxt > 4 then nxt = 1
end if
x = x + (nxt = 2) - (nxt = 4)
y = y + (nxt = 3) - (nxt = 1)
plane(x,y) =(plane(x,y) <> 1)
mx = min(x,mx)
wend
for x = mx to 100
for y
print chr$((plane(x,y)*3) + 32);
next y
print x
next x
</lang>
=={{header|TI-83 BASIC}}==
|