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. */
} else {
printf (" %s is the correct answer.",
item->response);
- if (item->score >= 0)
- unlearned++;
- item->score--;
/* Penalize an incorrect response by forcing the score
* negative. */
if (item->score >= 0) {
- item->score = -1;
- printf ( " Oops, you knew that, right?\n ");
+ 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
+ * a correct response without any learning). */
+ item->score = -2;
+ } else {
+ item->score--;
}
}
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));
mnemon_load (&mnemon);
- mnemon_do_challenges (&mnemon, 10);
+ mnemon_do_challenges (&mnemon,
+ to_introduce,
+ to_master);
mnemon_save (&mnemon);