Brass Core Plugins


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


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


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


; 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)

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