ABC problem: Difference between revisions

Content added Content deleted
imported>Louisono
(add Elm solution)
imported>Louisono
m (renaming variables + reformatting for clearer solution)
Line 3,912: Line 3,912:


main =
main =
let resultStr (w, b) = "\"" ++ w ++ "\"" ++ ": " ++ if b then "True" else "False" in
let resultStr (word, canBeWritten) = "\"" ++ word ++ "\"" ++ ": " ++ if canBeWritten then "True" else "False" in
List.map (\ w -> (w, canMakeWord exampleBlocks w) |> resultStr) exampleWords
List.map (\ word -> (word, canMakeWord exampleBlocks word) |> resultStr) exampleWords
|> List.map (\s -> p [][text s])
|> List.map (\result -> p [] [ text result ])
|> div []
|> div []
</syntaxhighlight>
</syntaxhighlight>