Talk:Spiral matrix: Difference between revisions
→As an exercise in Turtle Graphics.: new section
(→Really long line in C#: Ta.) |
(→As an exercise in Turtle Graphics.: new section) |
||
Line 321:
:: It's a lot better, thanks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:46, 30 September 2015 (UTC)
== As an exercise in Turtle Graphics. ==
I'll be coding this up in Quackery soon, but, as it's 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
---+---------------
0| 0 1 2 3 4
1| 15 16 17 18 5
2| 14 23 24 19 6
3| 13 22 21 20 7
4| 12 11 10 9 8
The turtle starts at (0,0) facing east.
When it moves, it leaves a trail of numbers behind it.
"right" means "turn right 90 degrees".
These are its moves and turns to fill a 5*5 matrix.
4 move right
4 move right 4 move right
3 move right 3 move right
2 move right 2 move right
1 move right 1 move right
0 move</pre>
--[[User:GordonCharlton|GordonCharlton]] ([[User talk:GordonCharlton|talk]]) 15:52, 9 February 2022 (UTC)
|