while (1) {
if (category->time_limit > 0.0) {
- readline ("The next one is timed. Press enter when ready:");
+ response = readline ("The next one is timed. Press enter when ready:");
+ free (response);
}
printf ("%s\n", item->challenge);
return;
}
- if (response[0] == '/')
+ if (response[0] == '/') {
mnemon_handle_command (mnemon, response + 1);
- else
+ free (response);
+ } else {
break;
+ }
}
mnemon_handle_response (mnemon, bin, item_index,
(end.tv_sec + end.tv_usec / 1e6) -
(start.tv_sec + start.tv_usec / 1e6),
category->time_limit);
+ free (response);
} while (mnemon->to_introduce ||
mnemon->unlearned ||
mnemon->to_master > 0);
- printf ("Great job.\n");
+ printf ("Great job.\nHere are your current results:\n");
+ mnemon_print_histogram (mnemon, NULL, 0);
+ response = readline ("Press enter to quit.\n");
+ free (response);
}
int