Jump to content

Matrix transposition: Difference between revisions

→‎{{header|C}}: avoid unnecessary moves
(→‎{{header|C}}: avoid unnecessary moves)
Line 239:
double tmp;
 
for (start = 10; start <= w * h - 21; start++) {
next = start;
i = 0;
do { next = (next % h) * w + next / h; } while (next > start);
do { i++;
if (next < start) continue;
do { next = (next % h) * w + next / h; } while (next > start);
} while (next > start);
if (next < start || i == 1) continue;
 
tmp = m[next = start];
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.