Spiral matrix: Difference between revisions

Content added Content deleted
(Added Quackery.)
m (→‎{{header|Quackery}}: made walking more efficient)
Line 4,119: Line 4,119:


=={{header|Quackery}}==
=={{header|Quackery}}==

This task really lends itself to a turtle graphics metaphor. Some of the other approaches are impressive in their cleverness, but this finds the simplicity in the task.


There's more about the section marked <code>( turtle draws spiral )</code> in the [[Talk:Spiral_matrix#As_an_exercise_in_Turtle_Graphics.|Talk page]].
There's more about the section marked <code>( turtle draws spiral )</code> in the [[Talk:Spiral_matrix#As_an_exercise_in_Turtle_Graphics.|Talk page]].
Line 4,130: Line 4,132:
heading put ] is right ( --> )
heading put ] is right ( --> )
[ heading share 0 peek
[ times
unrot times
[ position share
[ position share
stepcount share
stepcount share
unrot poke
unrot poke
1 stepcount tally
over position tally
heading share 0 peek
1 stepcount tally ]
position tally ] ] is walk ( [ n --> [ )
nip ] is walk ( [ n --> [ )


[ dip [ temp put [] ]
[ dip [ temp put [] ]