]> git.cworth.org Git - mnemon/commitdiff
Introduce only 3 instead of 10 new items, and add mastery training before exiting.
authorCarl Worth <cworth@cworth.org>
Sun, 22 Apr 2007 17:48:11 +0000 (10:48 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 22 Apr 2007 17:48:11 +0000 (10:48 -0700)
mnemon.c

index 920f548f83466729a5c27f4cd2523b99d207774b..f4af000a5e413cc59a71860cec0c18f429c5ccb8 100644 (file)
--- a/mnemon.c
+++ b/mnemon.c
@@ -627,14 +627,15 @@ mnemon_select_item (mnemon_t       *mnemon,
 
 static void
 mnemon_do_challenges (mnemon_t *mnemon,
-                     int       to_introduce)
+                     int       to_introduce,
+                     int       to_master)
 {
     bin_t *bin;
     int item_index;
     item_t *item;
     char *response;
     bool_t correct;
-    int unlearned;
+    int unlearned, mastered = 0;
     int i;
 
     /* Count the number of items with negative scores. */
@@ -714,6 +715,7 @@ mnemon_do_challenges (mnemon_t *mnemon,
                if (item->score > 0)
                    printf ( " Oops, you knew that, right?\n ");
                unlearned++;
+               mastered = 0;
                /* We go to -2 to force a little extra reinforcement
                 * when re-learning an item, (otherwise, it will often
                 * get asked again immediately where it is easy to get
@@ -731,20 +733,28 @@ mnemon_do_challenges (mnemon_t *mnemon,
            printf (" ");
        if (unlearned)
            printf ("%d still unlearned.", unlearned);
-       if (to_introduce == 0 && unlearned == 0)
-           printf ("Great job!");
+       if (to_introduce == 0 && unlearned == 0) {
+           if (mastered < to_master)
+               printf ("%d items to master",
+                       to_master - mastered);
+           else
+               printf ("Great job!");
+           mastered++;
+       }
        printf (")\n\n");
 
        bin = mnemon_get_bin (mnemon, item->score);
 
        bin_add_item (bin, item);
-    } while (unlearned || to_introduce);
+    } while (mastered <= to_master);
 }
 
 int
 main (int argc, char *argv[])
 {
     mnemon_t mnemon;
+    int to_introduce   = 3;
+    int to_master      = 10;
 
     srand (time (NULL));
 
@@ -752,7 +762,9 @@ main (int argc, char *argv[])
 
     mnemon_load (&mnemon);
 
-    mnemon_do_challenges (&mnemon, 10);
+    mnemon_do_challenges (&mnemon,
+                         to_introduce,
+                         to_master);
 
     mnemon_save (&mnemon);