Cartesian product of two or more lists: Difference between revisions
Cartesian product of two or more lists (view source)
Revision as of 19:06, 22 January 2024
, 4 months agoAdded Easylang
Langurmonkey (talk | contribs) (→{{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===
|