Skip to content

API documentation

Chase Ries edited this page Nov 26, 2019 · 6 revisions

circularN

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

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.

circularPrev

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.

range

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.

Clone this wiki locally