Wordle comparison: Difference between revisions
m
→{{header|Python}}: Pruned out a redundant zip
m (→{{header|Haskell}}: Replaced bimap with `first`) |
m (→{{header|Python}}: Pruned out a redundant zip) |
||
Line 460:
charCounts(residue)
)(
)[1]
# green :: String -> (Char, Char) -> (String, (Char, Int))
def green(residue, tg):
'''The existing residue of unmatched characters, tupled
Line 473:
'''
t, g = tg
return (residue, (g, 2)) if t == g else (
[t] + residue, (g, 0)
)
|