taking customizer input and using it in a pair of nested loops
I'd like the user to be able to provide a comma separated string as input,
e.g., "2,4,11,8" and then use that information inside a nested For loop to
decide whether to perform an action. For example, if the sum of the two
loop counters is one of the numbers in the string then don't do the action.
I've tried using str() and search() and have gotten close but the "11" above
is matching with i+j = 1.
I understand your problem that you want to "parse" a string containing a
comma-separated list of numbers into a vector. In short "2,4,11,8" ->
This is not so trivial. See the following code.
a = "2,4,116,8"; // input
nums = "0123456789"; // helper
function parse() = let(comma = [-1, each search(",", a, 0), len(a)])
[for(i=[0:len(comma)-2]) vec2num(digitvector(comma, i))];
function digitvector(comma, n) = [for(i=[comma[n]+1:comma[n+1]-1]) a[i]];