Sep-26-2020, 11:01 AM
Do you know the game Snake?
I have no working code, but the idea to create the number spiral with the same logic.
Your snake has a position (y,x) and a direction. Depending on the direction 1 is added/subtracted to y-index or x-index.
The snake starts in the left corner (0,0) and goes to right direction (x + 1) till the boundary. Then the direction is down.
Maybe I come later back with some example code or someone else gives more hints.
It's not so easy to it right.
I have no working code, but the idea to create the number spiral with the same logic.
Your snake has a position (y,x) and a direction. Depending on the direction 1 is added/subtracted to y-index or x-index.
The snake starts in the left corner (0,0) and goes to right direction (x + 1) till the boundary. Then the direction is down.
Maybe I come later back with some example code or someone else gives more hints.
It's not so easy to it right.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!