In J, how do you idiomatically amend an array when you have:
substitution0 multipleIndices0
...
substitutionN multipleIndicesN
(not to be confused with:
substitution0 multipartIndex0
...
substitutionN multipartIndexN
)
For example, my attempt at the classic fizzbuzz problem looks like this:
i=.3 :'<@I.(,*./)(=<.)3 5%~"(0 1)y'
d=.1+i.20
'fizz';'buzz';'fizzbuzz' (i d)};/d
|length error
| 'fizz';'buzz';'fizzbuzz' (i d)};/d
I have created the verb m} where m is i d which is 3 boxes containing different-sized lists of 1-dimensional indices, whereas I think } expects m to be boxes containing single lists that each represent a single index with dimensions at least as few as the rank of the right argument.
How is this generally solved?