Loop over multiple arrays simultaneously: Difference between revisions

Content deleted Content added
Add Jsish
Line 3,106: Line 3,106:


1..$x::length -> '$x($it);$y($it);$z($it);
1..$x::length -> '$x($it);$y($it);$z($it);
' -> stdout
' -> !OUT::write
</lang>
</lang>
{{out}}
{{out}}
Line 3,123: Line 3,123:


[$x, $y, $z] -> transpose... -> '$($it...)
[$x, $y, $z] -> transpose... -> '$($it...)
' -> stdout
' -> !OUT::write
</lang>
</lang>
A more complex transpose that uses "foreach" more in line with the task proposal and handles uneven arrays
A more complex transpose that uses "foreach" more in line with the task proposal and handles uneven arrays
Line 3,140: Line 3,140:


[$x, $y, $z] -> transpose2... -> '$($it...)
[$x, $y, $z] -> transpose2... -> '$($it...)
' -> stdout
' -> !OUT::write


'
'
' -> stdout
' -> !OUT::write


[$u,$v,$w] -> transpose2... -> '$($it...)
[$u,$v,$w] -> transpose2... -> '$($it...)
' -> stdout
' -> !OUT::write
</lang>
</lang>
{{out}}
{{out}}