new array method - cycle([shift])
Posted: Sun Jul 19, 2015 4:07 am
array.cycle() will move array backwards or forwards in-place as it were a conveyor belt.
{1, 2, 3}.cycle()
Will make it:
{3, 1, 2}
Accepts a negative value as a shift to move different direction.
* Currently only shift by 1 element is supported.
The performance probably is horrible like O( 2*N ), but still a way faster than trying it in eScript.
Very useful if you are into advanced scripting and for debugging purposes.
PS: Turley please start adding these useful methods. I have more from where that came from with thorough explanation of what they do.
PSS: Are you annoyed by my banner? Should I remove it? Becasue I am.
{1, 2, 3}.cycle()
Will make it:
{3, 1, 2}
Accepts a negative value as a shift to move different direction.
* Currently only shift by 1 element is supported.
The performance probably is horrible like O( 2*N ), but still a way faster than trying it in eScript.
Very useful if you are into advanced scripting and for debugging purposes.
PS: Turley please start adding these useful methods. I have more from where that came from with thorough explanation of what they do.
PSS: Are you annoyed by my banner? Should I remove it? Becasue I am.