]> git.cworth.org Git - wordgame/blobdiff - word-game.c
grid: Don't consider 2-letter words as valid.
[wordgame] / word-game.c
index 8c9af9a59071feda5567f90cfecea9f014f32083..d4fa77e822582cc82086fc17779857a9baacaaad 100644 (file)
@@ -82,7 +82,7 @@ word_game_play (const char    *puzzle,
     for (i=0; i < 17; i++)
        possible_total += possible[i];
 
-    printf ("%s\n\n", puzzle);
+    printf ("%s\n", puzzle);
     just_saw_puzzle = TRUE;
 
     remaining = time_limit_seconds;
@@ -105,7 +105,7 @@ word_game_play (const char  *puzzle,
            break;
        if (strlen (response) == 0) {
            if (! just_saw_puzzle) {
-               printf ("%s\n\n", puzzle);
+               printf ("%s\n", puzzle);
                just_saw_puzzle = TRUE;
            } else {
                for (i = 2; i <= 17; i++)
@@ -146,14 +146,19 @@ word_game_play (const char        *puzzle,
        }
     } while (remaining > 0);
 
-    printf ("%s\n\n", puzzle);
+    printf ("%s\n", puzzle);
 
-    printf ("Words you found:\n");
-    dict_print_by_length_if (answers, seen_predicate);
+    if (found_total) {
+       printf ("Words you found:\n");
+       dict_print_by_length_if (answers, seen_predicate);
+       printf ("\n");
+    }
 
-    printf ("\nWords you missed:\n");
-    dict_print_by_length_if (answers, unseen_predicate);
-    printf ("\n");
+    if (found_total < possible_total) {
+       printf ("Words you missed:\n");
+       dict_print_by_length_if (answers, unseen_predicate);
+       printf ("\n");
+    }
 
     printf ("You found %d of %d words (%.2f%%)\n",
            found_total, possible_total,