Anonymous user
Set puzzle: Difference between revisions
m
→{{header|Haskell}}
(Added Haskell version) |
|||
Line 1,167:
combinations :: Int -> [a] -> [[a]]
combinations
combinations _
▲ | otherwise = map (y:) (combinations (k - 1) ys) ++ combinations k ys
data Color = Red | Green | Purple deriving (Show, Enum, Bounded, Ord, Eq)
Line 1,237 ⟶ 1,236:
main = do
showSolutions 9 4
showSolutions 12 6</lang>
{{out}}
<pre style="font-size:80%">Showing hand of 9 cards with 4 solutions.
Line 1,308 ⟶ 1,306:
</pre>
=={{header|J}}==
'''Solution:'''
|