-
Notifications
You must be signed in to change notification settings - Fork 0
API documentation
Usage
circularN(index, offset, array)
Explanation
Given an array
and a current index
, find what the index
would be if it were increased or decreased by integer value offset
. This function will wrap the offset around the array, such that a call to circularN(1, 2, [1,2,3])
would return the value 0
. Likewise, a call to circularN(1, -2, [1,2,3])
would produce 2
.
circularNext(index, array)
Explanation
Equivalent to circularN(index, 1, array)
. Given an array
and a current index
, find what the index
would be if it were increased by 1. This function will wrap the offset around the array, such that a call to circularNext(2, [1,2,3])
would produce 0
.
Usage
circularPrev(index, array)
Explanation
Equivalent to circularN(index, -1, array)
. Given an array
and a current index
, find what the index
would be if it were decreased by 1. This function will wrap the offset around the array, such that a call to circularPrev(0, [1,2,3])
would produce 2
.
Usage
range(start, stop, <step>)
Explanation
Produce an array containing all numbers from start
to stop
, inclusive to both arguments. Optionally include a step
value.