Randomize learn order and offsets

This commit is contained in:
Joscha 2018-01-05 17:04:08 +00:00
parent e10e1b930a
commit 8d882cf861
3 changed files with 18 additions and 8 deletions

View file

@ -10,6 +10,7 @@ import Data.Char
import Data.Time
import System.Console.Haskeline
import System.Console.Haskeline.History
import System.Random.Shuffle
type Input = InputT IO
@ -75,9 +76,8 @@ trim c = dropWhile (== c) . reverse . dropWhile (== c) . reverse
askElements :: UTCTime -> Elements -> Input Elements
askElements time elms = do
let l = toDueCards time elms
-- TODO: Randomize order
newCards <- askCountdown time l
cards <- lift $ shuffleM $ toDueCards time elms
newCards <- askCountdown time cards
return $ updateElements elms (fromCards newCards)
askCountdown :: UTCTime -> [(Integer, Card)] -> Input [(Integer, Card)]