Solve the no connection puzzle: Difference between revisions

m
→‎{{header|Haskell}}: Tidying, and pruned out one import.
m (→‎{{header|Haskell}}: Tidying, and pruned out one import.)
Line 1,580:
 
=={{header|Haskell}}==
<lang haskell>import Data.List (intercalate, permutations)
 
solution :: [Int]
Line 1,596:
main =
(putStrLn . unlines) $
unlines (zipWith (\x y -> x : (" = " ++ show y)) ['A' .. 'H'] solution) :
let rightShift s
((rightShift . unwords . fmap show) <$> [[], [a, b], [c, d, e, f], [g, h]])</lang>
| length s > 3 = s
where
| otherwise = " " ++ s
let rightShift s
in intercalate
| "\n"length s > 3 = s
| (zipWithotherwise (\x= y -> x : (" = " ++ show y)) ['A' .. 'H'] solution) :s</lang>
((rightShift . unwords . fmap show) <$> [[], [a, b], [c, d, e, f], [g, h]])</lang>
{{Out}}
<pre style="font-size:80%">A = 3
9,655

edits