Array.rotaterows()

Revision as of 19:59, 26 April 2020 by Swapna (talk | contribs) (Created page with "This function rotates rows in an array with mentioned number of iterations. ==Examples== 1. a=MAGICSQUARE(3) a.rotaterows(2) Output is displayed as: <br/>4 3 8 <br/>2 7 6...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function rotates rows in an array with mentioned number of iterations.

Examples

1.

a=MAGICSQUARE(3)
a.rotaterows(2)

Output is displayed as:
4 3 8
2 7 6
9 5 1


2.

a=[["red","brown"],["green","pink"],["blue","yellow"]];
a.rotaterows(1)

Output is displayed as:
green pink
blue yellow
red brown