]> git.cworth.org Git - mnemon/commitdiff
Reload file before printing final histogram
authorCarl Worth <cworth@cworth.org>
Sat, 14 Mar 2009 23:37:20 +0000 (16:37 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 14 Mar 2009 23:37:20 +0000 (16:37 -0700)
This allows bin 0 to be seen in the result.

mnemon.c

index bbc6456b60f9b9c8c4e78c9dfdfc84da36ce723b..db8f62fe87c917de251bcb4537c65eed7f65c15c 100644 (file)
--- a/mnemon.c
+++ b/mnemon.c
@@ -1184,17 +1184,13 @@ mnemon_do_challenges (mnemon_t *mnemon)
     } while (mnemon->to_introduce ||
             mnemon->unlearned ||
             mnemon->to_master > 0);
-
-    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
 main (int argc, char *argv[])
 {
     mnemon_t mnemon;
+    char *response;
 
     srand (time (NULL));
 
@@ -1208,5 +1204,15 @@ main (int argc, char *argv[])
 
     mnemon_fini (&mnemon);
 
+    mnemon_init (&mnemon);
+    mnemon_load (&mnemon);
+
+    printf ("Great job.\nHere are your current results:\n");
+    mnemon_print_histogram (&mnemon, NULL, 0);
+    response = readline ("Press enter to quit.\n");
+    free (response);
+
+    mnemon_fini (&mnemon);
+
     return 0;
 }