X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=mnemon.c;h=e13d3b9ff9f707f458a8ca02ec5b0c31818922a9;hb=a6ba5c83f3b9f07411c5e281488ced3b354d2b53;hp=67b5889dcfa1040d56c17a33bad250906bd94420;hpb=c99ea4af83e849df05018d4e72121f8f73de8bd2;p=mnemon diff --git a/mnemon.c b/mnemon.c index 67b5889..e13d3b9 100644 --- a/mnemon.c +++ b/mnemon.c @@ -637,8 +637,10 @@ mnemon_do_challenges (mnemon_t *mnemon) printf ("%s\n", item->challenge); response = readline ("> "); - if (response == NULL) + if (response == NULL) { + printf ("\n"); break; + } correct = (strcmp (response, item->response) == 0); @@ -648,17 +650,13 @@ mnemon_do_challenges (mnemon_t *mnemon) if (correct) { printf ("Correct!\n\n"); - if (item->count < 0) - item->count = 1; - else - item->count++; + item->count++; } else { printf (" %s is the correct answer.\n\n", item->response); + item->count--; if (item->count > 0) item->count = -1; - else - item->count--; } bin = mnemon_get_bin (mnemon, item->count);