I want to rearrange my array to output the same values as before but changing the order of the array diagonally.
I have a grid that can grow bigger or smaller in this case its 3x3
Example input: 0,1,2,3,4,5,6,7,8
(grid example below of my array with diagonally mirroring)
0,1,2
3,4,5
6,7,8
convert to:
0,3,6
1,4,7
2,5,8
For a small array I can do it manualy but for big ones i would like that ability to calculate / convert the array.