Langton's ant: Difference between revisions
m
100x100, inverted directions
m (output in smaller font) |
m (100x100, inverted directions) |
||
Line 4,030:
=={{header|Phix}}==
<lang Phix>sequence grid = repeat(repeat(' ',
integer aX =
gXY, angle =
constant dX = {0,-1,0,
while aX>=1 and aX<=
and aY>=1 and aY<=
gXY = grid[aX][aY]
grid[aX][aY] = 67-gXY -- ' '<=>'#', aka 32<->35
angle = mod(angle+2*gXY+
aX += dX[angle+1]
aY += dX[4-angle]
end while
puts(1,join(grid,"\n"))</lang>
{{out}}
<pre style="font-size: 2px">
"started"
# # # # # #
### # # # # ## ##
# # ### ## #### ## # # # ## ##
# ### ## # ## ### # # ### ###
# # ##### # # #### # ### # # #
### ## # #### ## ## ###### # ### # #
# ### # ## # # ## ## ## # ##### ### ##
# # # ## ### # # # #### # ##
# # ## ## # ## ## # ##
### # # ## ### # ## # ### ## ## #
# ### ## ## ## ### # # ## #### #
### # # # # # #### ## # ## ### # #
# ### # ## # # ### # ### ## # # ##
### # # ## # ## ## ##### #### #### ## #
# ### # # # # ### # # ## ## # # # # #
### # ## ### ## # ## #### #### # #
# ### # # # ## ########### # #### # # #
### # ## # #### ## ######### # ## # ##
# ### # # ## # ## ## ## ### ### # # ## #### #
### # ## # # ###### ## # ## # # ### ### ## #
# ### # # # ##### # ##### # # ## # ## #
### # ## # # ## ##### ## # # # # ## # # #
# ### # # # # #### # ##### ## ########## ##
### # ## # ## ## # # #### # ## #### ##
# ### # # ##### # ## ## # # # # # # # #
### # ## ## ## # # # ## ## # # ## # ## ##
# ### # # # # # ######## # # ## #### #
### # ## # # # ## ## # # ## #
# ### # # # # # # ## ## ## ####
### # ## ## # ## ## # # ###
### # ## ##
# ###
### # ##
### #
#
# ###
## # #
# # # #
#### ##
# ## #
####
##
</pre>
|