Langton's ant: Difference between revisions

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}}: changed/added comments and whitespace, changed indentations, used dynamic field, so the ant is less constricted for its walk.)
m (→‎{{header|REXX}}: added glyphs to the output to show the ant's walk started and where it went out-of-bounds.)
Line 4,677:
/*finished walking, it's out-of-bounds.*/
say center(" Langton's ant walked " steps ' steps. ', 79, "─")
@.1000000.1000000='█' /*show the ant's initial starting point*/
@.x.y= '∙' /*show where the ant went out-of-bounds*/
/* [↓] show Langton's ant's trail. */
do y=maxy to miny by -1; _= /*display a single row of cells. */
Line 4,685 ⟶ 4,687:
end /*y*/ /*stick a fork in it, we're all done. */</lang>
The terminal's screen size used was &nbsp; <big>80</big>x<big>160</big>.
 
The ant's walk starts at the &nbsp; █ &nbsp; glyph &nbsp; and &nbsp; ends at &nbsp; <big><b>'''∙'''</b></big> &nbsp; where it goes out-of-bounds.
 
'''output''' &nbsp; when using the default inputs:
Line 4,690 ⟶ 4,694:
<b>
<pre style="font-size:67%">
───────────────────── Langton's ant walked 12960 steps. ─────────────────────
# #
## # #
Line 4,744 ⟶ 4,748:
# ## # ## # # ##### # ##### # # # ### #
# ## ### ### # # ## # ## ###### # # ## # ###
# #### ## # # ### ### ## ## ## # ## # # ### #
## # ## # ######### ## #### # ## # ###
# # # #### # ########### ## # # # ### #