Difference between revisions of "Array.rotate()"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
 
 
Line 6: Line 6:
 
==Array.rotate(NoOfRotations) ==
 
==Array.rotate(NoOfRotations) ==
  
Rotate the matrix n times
+
Rotate the matrix n times. Works on multidimensional matrices also.
  
  

Latest revision as of 16:05, 4 March 2017


Array.rotate(NoOfRotations)

Rotate the matrix n times. Works on multidimensional matrices also.


[1,2,3].rotate(1)

[3, 1, 2]

MAGICSQUARE(3)

2 7 6
9 5 1
4 3 8

MAGICSQUARE(3).rotate(1)

9 2 7
4 5 6
3 8 1

MAGICSQUARE(3).rotate(2)

4 9 2
3 5 7
8 1 6