From 95950fcacd327b24eb22bad24d15f377c0640e2c Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 23 Sep 2006 03:56:00 -0700 Subject: [PATCH] Don't print empty found/missed sections --- word-game.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/word-game.c b/word-game.c index e12787d..d4fa77e 100644 --- a/word-game.c +++ b/word-game.c @@ -148,12 +148,17 @@ word_game_play (const char *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, -- 2.43.0