From: Carl Worth Date: Sun, 22 Apr 2007 17:48:11 +0000 (-0700) Subject: Introduce only 3 instead of 10 new items, and add mastery training before exiting. X-Git-Url: https://git.cworth.org/git?p=mnemon;a=commitdiff_plain;h=65180490193e204cbf150953d598bcadc57171d1 Introduce only 3 instead of 10 new items, and add mastery training before exiting. --- diff --git a/mnemon.c b/mnemon.c index 920f548..f4af000 100644 --- 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);