+ 3

Is there any way to loop through a n×n matrix like a snail?

Imagine we have a 3×3 matrix and I want to loop through the indexes like first I go through the first row, then the last column, then the last row, then the first column and like this way, reach the inner index. Is there anyway?

26th May 2020, 10:35 PM
Nika Soltani Tehrani
Nika Soltani Tehrani - avatar
1 Answer
26th May 2020, 11:51 PM
MO ELomari
MO ELomari - avatar