About Pi Downloads Documentation Plugins Developer Forum Issues

Array.rotate

Summary

Rotates array elements by given value.

Syntax

Array.rotate(value)

Example

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

See Also