Department numbers: Difference between revisions
Content deleted Content added
→{{header|Perl 6}}: Added Perl 6 solution |
→{{header|Haskell}}: Generalising a little more, to allow for experimentation ( bureaucracy grows ) |
||
Line 66:
=={{header|Haskell}}==
<lang Haskell>options :: Int -> Int -> Int -> [(Int, Int, Int)]
options lo hi total =
let ds = [
in
\x ->
-- TEST -----------------------------------------------------------------------
main :: IO ()
main = do
mapM_ print xs
mapM_ putStrLn ["\nNumber of options: ", show (length xs)]
</lang>
{{Out}}
<pre>(
(4,2,6)▼
(
(7,2,3)▼
(1,4,7)▼
(2,4,6)
(3,4,5)▼
(5,4,3)▼
(6,4,2)▼
(7,4,1)▼
(1,6,5)▼
(2,6,4)
(4,1,7)
▲(4,2,6)
(4,6,2)
(
Number of options:
|