From 09871f9d92dfbc060605c073f2615ebca6c12c94 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 24 Jun 2010 10:53:10 +0200 Subject: [PATCH] hangman(6): Ignore case in the word list. Reported-by: Tim Darby Dragonfly-bug: --- games/hangman/getguess.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/games/hangman/getguess.c b/games/hangman/getguess.c index b5b60c0015..c399029862 100644 --- a/games/hangman/getguess.c +++ b/games/hangman/getguess.c @@ -42,7 +42,7 @@ void getguess(void) { int i; - int ch; + int ch, uch; bool correct; leaveok(stdscr, FALSE); @@ -70,10 +70,14 @@ getguess(void) Guessed[ch - 'a'] = TRUE; correct = FALSE; + uch = toupper(ch); for (i = 0; Word[i] != '\0'; i++) { if (Word[i] == ch) { Known[i] = ch; correct = TRUE; + } else if (Word[i] == uch) { + Known[i] = uch; + correct = TRUE; } } if (!correct) -- 2.41.0