Talk:Spiral matrix: Difference between revisions

→‎As an exercise in Turtle Graphics.: updated now the code is posted
(→‎As an exercise in Turtle Graphics.: updated now the code is posted)
Line 324:
== As an exercise in Turtle Graphics. ==
 
I'll be coding this up inAS Quackery soon, but, as it'sis not a well known language, here are my working notes in case anyone wants to take this approach. I think they're self-explanatory.
 
<pre>x,y| 0 1 2 3 4
Line 335:
 
The turtle starts at (0,0) facing east.
 
When it moves, it leaves a trail of numbers behind it.
When it walks a specified distance, it
When it moves, it leaves a trail of numbers behind it.
 
"right" means "turn right 90 degrees".
 
These are its moves and turnsmovements to fill a 5*5 matrix.
 
4 walk right
 
4 movewalk right 4 walk right
3 movewalk right 3 movewalk right
2 movewalk right 2 movewalk right
1 movewalk right 1 movewalk right
 
41 move right 4 move right
3 move right 3 move right
2 move right 2 move right
1 move right 1 move right
 
("1 move": The turtle must vacate the final
0 move</pre>
position as it leaves numbers /behind/ it.)
</pre>
 
--[[User:GordonCharlton|GordonCharlton]] ([[User talk:GordonCharlton|talk]]) 1523:5212, 9 February 2022 (UTC)
1,462

edits