Anonymous user
Langton's ant: Difference between revisions
→{{header|Run BASIC}}
mNo edit summary |
|||
Line 2,224:
=={{header|Run BASIC}}==
<lang Runbasic>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
Line 2,239 ⟶ 2,236:
if nxt > 4 then nxt = 1
end if
x
y
plane(x,y)
mx
wend
graphic #g, 100,100
for x = mx to 100
for y = 1 to 100
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
next y
print x
next x
render #g
#g "flush"</lang>
output
Ouptut (Produces both character and graphic):[[File:LogansAnt.png|right|graphic]]
<pre style="height: 40ex; overflow: scroll">
## 21
|