Solve the no connection puzzle: Difference between revisions
→{{header|Haskell}}: Slight tidying
(→{{header|Haskell}}: Slight tidying) |
|||
Line 793:
=={{header|Haskell}}==
<lang haskell>import Data.List (
solution :: [Int]
Line 800:
isSolution :: [Int] -> Bool
isSolution (a:b:c:d:e:f:g:h:_) =
all ((> 1) . abs) $
[a, c,
[d, d, d, d, c, g,
main :: IO ()
main =
let rightShift s
| length s > 3 = s
Line 828 ⟶ 814:
in intercalate
"\n"
(zipWith (\x y -> (
((rightShift . unwords .
{{Out}}
<pre style="font-size:80%">A = 3
|