Jump to content

Cartesian product of two or more lists: Difference between revisions

Added Easylang
(→‎{{header|langur}}: updated to use mapX() instead of X())
(Added Easylang)
Line 1,747:
 
[]</pre>
=={{header|EasyLang}}==
{{trans|Go}}
<syntaxhighlight>
proc cart2 a[] b[] . p[][] .
p[][] = [ ]
for a in a[]
for b in b[]
p[][] &= [ a b ]
.
.
.
cart2 [ 1 2 ] [ 3 4 ] r[][]
print r[][]
cart2 [ 3 4 ] [ 1 2 ] r[][]
print r[][]
cart2 [ 1 2 ] [ ] r[][]
print r[][]
cart2 [ ] [ 1 2 ] r[][]
print r[][]
</syntaxhighlight>
 
=={{header|Erlang}}==
Can do this with list comprehensions.
Line 1,766 ⟶ 1,787:
[{3,1},{3,2},{4,1},{4,2}]
</pre>
 
=={{header|F Sharp|F#}}==
===The Task===
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.