Imagine a diamond-shaped isometric map, which is basically a 2D array with (x,y) coordinates and the top cell as the origin, as marked in the cells:

I want to iterate through these cells from back to front, in the following order:

What’s the algorithm to loop in this way through an unknown same-sided map?
Expected output: [0,0], [0,1], [1,0], [0,2], [1,1], [2,0], [0,3], etc
python pseudocode:
output: