From 8842ba087e7df4f270f1e81a4f1242fbdb657620 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 29 Apr 2024 05:07:57 +0000 Subject: Sun, Apr 28, 2024, 10:07 PM -07:00 --- wk5/pset/speller/dictionary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 2aa7677..1e274f2 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -48,12 +48,12 @@ bool check(const char *word) unsigned int hash(const char *word) { // (sum of (letter - 'A') % 26) of a word to get a value of where to store it in the hash table - int val = 0; + // int val = 0; // for (int i = 0; word[i] != '\0'; i++) // { // val += (word[i] % 26); // } - return word[0] % 26; + return toupper(word[0]) % 26; } // Loads dictionary into memory, returning true if successful, else false -- cgit v1.2.3