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-56; sw=sw01sw-1 /*adjust for terminal's useable area. */
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); minymaxx=minmax(minymaxx,y x) /*find the minimum and maximum of X. */
maxxminy=maxmin(maxxminy,x y); maxy=max(maxy, y) /* " " " " " " Y. */
end /*steps*/
/*finished walking, it's out-of-bounds.*/