How do I scan it diagonally? I have it stored as an array [x] [y].

I've tried but my head is not made for solving this, I run into step problem or out of array boundary problem.
So solution would need to be able to take steps that give diagonal scan and also be carefull about geting out of boundary.
Starting from 1,1 scan down to 9,9 going thru [2,2] [3,3] [4,4] etc.
then take the next scan [2,1] [3,2]
I would like to do this with for-loops, anyone here knows how to do it?
If so please show me in pseudo code how to do it.
I'll pay if neccessary, 20$ for solution just help me solve this before my head starts to pulsate :)

I've tried but my head is not made for solving this, I run into step problem or out of array boundary problem.
So solution would need to be able to take steps that give diagonal scan and also be carefull about geting out of boundary.
Starting from 1,1 scan down to 9,9 going thru [2,2] [3,3] [4,4] etc.
then take the next scan [2,1] [3,2]
I would like to do this with for-loops, anyone here knows how to do it?
If so please show me in pseudo code how to do it.
I'll pay if neccessary, 20$ for solution just help me solve this before my head starts to pulsate :)