Loop over multiple arrays simultaneously: Difference between revisions
Loop over multiple arrays simultaneously (view source)
Revision as of 08:52, 23 January 2023
, 1 year ago→{{header|J}}
m (→{{header|Kotlin}}: edited a comment and removed a typo) |
m (→{{header|J}}) |
||
Line 2,021:
(An "empty box" is what a programmer in another language might call
"a pointer to a zero length array".)
That said, it's also worth noting that a single explicit loop could also be used here. For example,
<syntaxhighlight lang=J>
charcols=: {{
'one two three'=. y
for_a. one do.
echo a,(a_index{two),":a_index{three
end.
}}
charcols 'abc';'ABC';1 2 3
aA1
bB2
cC3</syntaxhighlight>
=={{header|Java}}==
|