From a18cd5ef8da0ae6a4d35530e39b8ed1f458ac28f Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 20 Sep 2018 18:13:08 +0000 Subject: [PATCH] Fix worst-case score calculation --- src/Jotto.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jotto.hs b/src/Jotto.hs index ee5ef85..0dd3143 100644 --- a/src/Jotto.hs +++ b/src/Jotto.hs @@ -151,7 +151,7 @@ worstCase :: Class -> M.Map Class Int -> Int worstCase c cmap = let solutions = M.mapKeysWith (+) (score c) cmap maxHitCount = maximum solutions - minEliminated = M.size cmap - maxHitCount + minEliminated = sum cmap - maxHitCount in minEliminated nextGuesses :: GuessState -> [(Int, [String])]