Wordle comparison: Difference between revisions

m
(→‎{{header|Haskell}}: Added a version in Haskell.)
Line 163:
amber
(charCounts residue)
(zip matches guess matches)
 
green :: String -> (Char, Char) -> (String, Int)
Line 170:
| otherwise = (t : residue, 0)
 
amber :: Tally -> (IntChar, CharInt) -> (Tally, Int)
amber tally (2_, _2) = (tally, 2)
amber tally (_c, c0)
| 0 < fromMaybe 0 (M.lookup c tally) =
(M.adjust pred c tally, 1)
9,655

edits