Langton's ant: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: (hopefully) clarified what is displayed in the section header. -- ~~~~)
Line 2,431: Line 2,431:
y = y + (nxt = 3) - (nxt = 1)
y = y + (nxt = 3) - (nxt = 1)
plane(x,y) = (plane(x,y) <> 1)
plane(x,y) = (plane(x,y) <> 1)
mx = min(x,mx)
my = min(y,my)
wend
wend
graphic #g, 100,100
graphic #g, 100,100
for x = mx to 100
for y = my to 100
for y = 1 to 100
for x = 1 to 100
print chr$((plane(x,y)*3) + 32);
print chr$((plane(x,y)*3) + 32);
if plane(x,y) = 1 then #g "color green ; set "; x; " "; y else #g "color blue ; set "; x; " "; y
if plane(x,y) = 1 then #g "color green ; set "; x; " "; y else #g "color blue ; set "; x; " "; y
next y
next x
print x
print y
next x
next y
render #g
render #g
#g "flush"</lang>
#g "flush"</lang>