clanki 1.0.4 → 1.0.5
raw patch · 3 files changed
+8/−8 lines, 3 files
Files
- clanki.cabal +1/−1
- src/Main.hs +4/−4
- src/Quiz.hs +3/−3
clanki.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: clanki-version: 1.0.4+version: 1.0.5 synopsis: Command-line spaced-repetition software description: Command-line spaced-repetition learning software. CL (command line) + Anki (popular spaced-repetition software) = Clanki. Usage is fairly simple, just follow the instructions after running the program. Add a deck, add cards to the deck, then quiz whenever possible. The program will determine what cards need to be reviewed, using the Super Memo 2 algorithm. license: MIT
src/Main.hs view
@@ -8,7 +8,7 @@ import System.Directory(doesFileExist) import Display-data Action = Quiz | Add | Remove | Quit {--| Show --} deriving (Show, Eq, Ord, Enum)+data Action = Quiz | Add | Remove | Show | Quit deriving (Show, Eq, Ord, Enum) instance Display Action where display act = show act@@ -26,9 +26,9 @@ Just Add -> addLoop decks >>= mainLoop Just Quiz -> quizLoop decks >>= mainLoop Just Remove -> removeLoop decks >>= mainLoop- {-Just Show -> do-}- {-showDecks decks -}- {-mainLoop decks-}+ Just Show -> do+ printf $ show decks ++ "\n"+ mainLoop decks Nothing -> do printf $ "Invalid input" ++ "\n" mainLoop decks
src/Quiz.hs view
@@ -35,7 +35,7 @@ | quizAct == Just FromDeck = do input <- Input.getUserChoice decks case input of- Just deck -> return decks+ Just deck -> quizFromDeck deck decks Nothing -> return decks | otherwise = return decks @@ -84,8 +84,8 @@ -{-quizFromDeck :: Deck -> [Deck] -> IO [Deck]-}-{-quizFromDeck deck decks = return decks-}+quizFromDeck :: Deck -> [Deck] -> IO [Deck]+quizFromDeck deck decks = quizDeck deck >>= (\newDeck -> return $ replaceDeckNamed (dName deck) newDeck decks) getQuizAction :: [Deck] -> IO (Maybe QuizAction) getQuizAction decks = Input.getUserChoice allQuizActions