printf ("%s\n", item->challenge);
response = readline ("> ");
- if (response == NULL)
+ if (response == NULL) {
+ printf ("\n");
break;
+ }
correct = (strcmp (response, item->response) == 0);
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);