Anonymous user
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''',
<br>Or in other words,
<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 /*
bb=1 ; tb=100 /*bottom " top " */
x=(rb-lb)%2 ; y=(tb-bb)%2 /*approximate center (walk start)*/
|