Jump to content

Twelve statements: Difference between revisions

m
(→‎{{header|Haskell}}: using unicode operators. Might not be a terribly smart thing to do, those who know haskell, feel free to change it)
Line 22:
Extra credit: also print out a table of near misses, that is, solutions that are contradicted by only a single statement.
=={{header|Haskell}}==
<lang haskell>tf [x] = [mapM (\_ -> [True], [False]])
tf (x:xs) = map (True:) s ++ map (False:) s where s = tf xs
 
sumbool = length . filter id
wrongness b = sumbool . zipWith (/=) b . map (\f -> f$ b)
 
statements = [ (==12) . length,
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.