Traverse Matrix in Reverse Diagonal strips
Straight lines are defined by linear equations. Assuming arrays indexed from zero, as in&nbsp;C, you want the lines $x-y=c$ for $c=2,\,1,\,0,\,-1,\,-2$. This gives something like

for c := 2 to -2 step -1
    for x := 0 to 2
        y := x-c
        if 0&lt;=y&lt;=2
            print A[x,y]