Clean up
This commit is contained in:
parent
2a9f7c6f6b
commit
dfc628d090
2 changed files with 6 additions and 6 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.List
|
|
||||||
import Data.Char
|
import Data.Char
|
||||||
|
import Data.List
|
||||||
import System.Environment
|
import System.Environment
|
||||||
import System.Exit
|
import System.Exit
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ guessState :: ClassMap -> GuessState
|
||||||
guessState cmap = GuessState{guessed=[], allWords=cmap}
|
guessState cmap = GuessState{guessed=[], allWords=cmap}
|
||||||
|
|
||||||
addGuess :: Guess -> GuessState -> GuessState
|
addGuess :: Guess -> GuessState -> GuessState
|
||||||
addGuess guess g = g{guessed=guess : (guessed g)}
|
addGuess guess g = g{guessed=guess : guessed g}
|
||||||
|
|
||||||
removeGuess :: String -> GuessState -> GuessState
|
removeGuess :: String -> GuessState -> GuessState
|
||||||
removeGuess w g =
|
removeGuess w g =
|
||||||
|
|
@ -158,7 +158,7 @@ worstCase c cmap =
|
||||||
nextGuesses :: GuessState -> [(Int, [String])]
|
nextGuesses :: GuessState -> [(Int, [String])]
|
||||||
nextGuesses g =
|
nextGuesses g =
|
||||||
let pwords = possibleWords g
|
let pwords = possibleWords g
|
||||||
lpwords = M.map length $ pwords
|
lpwords = M.map length pwords
|
||||||
pclasses = M.keysSet pwords
|
pclasses = M.keysSet pwords
|
||||||
options1 = M.assocs $ allWords g
|
options1 = M.assocs $ allWords g
|
||||||
options2 = parMap rdeepseq (\(set, w) -> (set, worstCase set lpwords, w)) options1
|
options2 = parMap rdeepseq (\(set, w) -> (set, worstCase set lpwords, w)) options1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue