Loop over multiple arrays simultaneously: Difference between revisions
Content added Content deleted
m (→{{header|Kotlin}}: edited a comment and removed a typo) |
m (→{{header|J}}) |
||
Line 2,021: | Line 2,021: | ||
(An "empty box" is what a programmer in another language might call |
(An "empty box" is what a programmer in another language might call |
||
"a pointer to a zero length array".) |
"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}}== |
=={{header|Java}}== |