Brass Core Plugins

choose

Chooses a value from a list of values based on an index number. The list has a base index of 1, not 0.

Syntax

choose(index, value1, value2, ...)

Remarks

If the index value is negative then the value from the end of the list is chosen instead.

Example

; Define some prime numbers:
#define primes 2, 3, 5, 7, 11, 13

; Iterate over the list from start to end:
.echoln "Forwards:"
#for i is +1 to +6
.echoln choose(i, primes)
#loop

; Iterate over the list backwards:
.echoln "Backwards:"
#for i is -1 to -6
.echoln choose(i, primes)
#loop