Skip to content

Commit

Permalink
[mmzk] (feat) 2023 Part II matches
Browse files Browse the repository at this point in the history
  • Loading branch information
MMZK1526 committed Mar 5, 2024
1 parent 54c8667 commit 65b17a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Year2023/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ split3M xs
-- Part II

matches :: String -> ParseTree -> Bool
matches
= undefined
matches clue (Synonym str) = clue `elem` synonyms str
matches clue (Anagram _ str) = sort clue == sort str
matches clue (Reversal _ tree) = matches (reverse clue) tree
matches clue (Insertion _ t1 t2) = or [ matches c1 t1 && matches c2 t2
| (c1, c2) <- uninsert clue ]
matches clue (Charade _ t1 t2) = or [ matches c1 t1 && matches c2 t2
| (c1, c2) <- split2 clue ]

evaluate :: Parse -> Int -> [String]
evaluate
evaluate (defs, _, tree) size
= undefined

------------------------------------------------------
Expand Down

0 comments on commit 65b17a7

Please sign in to comment.