Langton's ant: Difference between revisions

m
→‎{{header|REXX}}: corrected a comment, changed the wording in the REXX section header. -- ~~~~
m (→‎{{header|REXX}}: corrected a comment, changed the wording in the REXX section header. -- ~~~~)
Line 2,925:
 
=={{header|REXX}}==
This REXX program automatically justifies (or ''crops'') the '''left''', and'''right''', '''top''' (toand the'''bottom''' screen)of the ant's walk field on the screen.
<br>Or in other words, thethis REXX program only shows the pertinent part of the ant's walk-field.
<lang rexx>/*REXX program implements Langton's ant and displays the path it walked.*/
parse arg dir . /*allow specification: ant facing*/
/*binary colors: 0=white, 1=black*/
@.=0 /*define stem array (all white).*/
lb=1 ; rb=100 /* rightleft boundry, right boundry.*/
bb=1 ; tb=100 /*bottom " top " */
x=(rb-lb)%2 ; y=(tb-bb)%2 /*approximate center (walk start)*/