Langton's ant: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added glyphs to the output to show the ant's walk started and where it went out-of-bounds.) |
m (→{{header|REXX}}: adjusted useable screen size.) |
||
Line 4,656:
if char=='' | char=="," then char= '#' /*binary colors: 0≡white, 1≡black. */
parse value scrSize() with sd sw . /*obtain the terminal's depth and width*/
sd=sd-
x=1000000 ; y=1000000 /*start ant's walk in middle of nowhere*/
$.=1; $.0=4 ; $.2=2; $.3=3; $.4=4 /* 1≡north 2≡east 3≡south 4≡west.*/
Line 4,672:
when dir==4 then x= x - 1 /* " " " west? " " left. */
end /*select*/
minx=min(minx, x);
end /*steps*/
/*finished walking, it's out-of-bounds.*/
|