Array.rotate()

From ZCubes Wiki
Revision as of 17:05, 4 March 2017 by Joseph (talk | contribs) (Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Array.rotate(NoOfRotations)

Rotate the matrix n times


[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