Commit 7d5cd2f4 authored by gga19's avatar gga19
Browse files

Added split string function

parent 64cd1480
......@@ -30,3 +30,9 @@ solveAnswers clue wordLength answers
= solveEach clue wordLength as
| otherwise
= head (solveWithAnswerReturn (clue, wordLength) a) : solveEach clue wordLength as
wordsWhen :: (Char -> Bool) -> String -> [String]
wordsWhen p s = case dropWhile p s of
"" -> []
s' -> w : wordsWhen p s''
where (w, s'') = break p s'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment