|
|
> I might try to code it up tonight, unless someone beats me to it ;)
or over lunch :D
Like so:
#macro CycleValues (_Array, _Counter)
// Round-robin cycle through N values
// Bill Walker September 2017
#local N = dimension_size (_Array, 1);
#local selector = mod (_Counter, N);
// selector will range from 0 to N-1
// Return the value in _Array corresponding to _Counter
_Array [selector]
#end // end macro CycleValues
#declare RoundRobin = array [4] {2, 5, 9, 13};
#for (i, 0, 10)
#declare Value = CycleValues (RoundRobin, i);
#debug concat ("Array value for i=", str(i, 2, 0), " is ", str(Value, 3, 0),
"\n")
#end // end for i
Post a reply to this message
|
|