Anonymous user
Loop over multiple arrays simultaneously: Difference between revisions
Loop over multiple arrays simultaneously (view source)
Revision as of 11:39, 25 January 2024
, 3 months ago→{{header|Elena}}
(Added Easylang) |
imported>Arakov |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1,753:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'routines;
import extensions;
Line 1,763:
var a3 := new int[]{1,2,3};
for(int i := 0
{
console.printLine(a1[i], a2[i], a3[i])
Line 1,783:
.zipBy(a3, (first,second => first + second.toString() ));
zipped.forEach::(e)
{ console.writeLine:e };
Line 4,695:
=={{header|Wren}}==
The following script will work as expected provided the lengths of a1 and a2 are at least equal to the length of a3. Otherwise it will produce a 'Subscript out of bounds' error.
<syntaxhighlight lang="
var a2 = ["A", "B", "C"]
var a3 = [1, 2, 3]
|