One possible solution would be to traverse the first row until you need to stop, then change the direction and traverse downwards until you need to stop and then traverse to left and eventually up. At that point you would be one row below the starting point. Then just repeat the process until done.
I guess that could be the way how I would implement it if I was trying to solve the problem.
I hope that helps someIn reply to Re: spiral path traversal for a grid
by negation
in thread spiral path traversal for a grid
by frenchtoast
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |