Difference between revisions of "Array.rotatecolumns()"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "This function rotates columns in an array with mentioned number of iterations. ==Examples== 1. a=MAGICSQUARE(3) a.rotatecolumns(2) In above example, column values are rota...")
 
Line 1: Line 1:
 +
*[[ Z3 | << Z3 Home ]]
 +
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 +
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 +
 
This function rotates columns in an array with mentioned number of iterations.
 
This function rotates columns in an array with mentioned number of iterations.
  

Revision as of 02:08, 30 April 2020

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

Examples

1.

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

In above example, column values are rotated twice. Output is displayed as:
6 2 7
1 9 5
8 4 3


2.

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

In above example, column values are rotated once. Output is displayed as:
brown red
pink green
yellow blue

See Also

rotaterows