Langton's ant: Difference between revisions
→{{header|Run BASIC}}: Toggle before moving, not after (actual source of chirality problem)
(→{{header|Run BASIC}}: Fix chirality of text output.) |
(→{{header|Run BASIC}}: Toggle before moving, not after (actual source of chirality problem)) |
||
Line 2,427:
if nxt > 4 then nxt = 1
end if
plane(x,y) = (plane(x,y) <> 1)▼
x = x + (nxt = 2) - (nxt = 4)
y = y + (nxt = 3) - (nxt = 1)
▲plane(x,y) = (plane(x,y) <> 1)
my = min(y,my)
wend
Line 2,447 ⟶ 2,448:
output
Ouptut (Produces both character and graphic):[[File:LogansAnt.png|right|graphic]]
<pre style="height: 40ex; overflow: scroll">
#
# # # # ##
# ####
# # ## ##
##
### ## ###
# #####
## # ## # # # ## # ## ###
# #### ## # # #
### # # ### ####
# ## ## ## #
## ## # ###
## # ## ## #
## # ###
# ## ## # 71
## # ### 72
# ## ## # 73
## # ### 74
# ## ## # 75
## # ### 76
# ## ## # 77
## # ### 78
# ## ## # 79
## # ### 80
# ## ## # 81
## # ### 82
# ## ## # 83
## # ### 84
# ## ## # 85
## # ### 86
# ## ## # 87
## # ### 88
# ## ## # 89
## # ### 90
# ## ## # 91
## # ### 92
# ## ## # 93
## # ### 94
# ## ## # 95
## # ##### 96
# # #### 97
## ### # 98
# # ## 99
100
</pre>
=={{header|Scala}}==
|