diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 04:19:04 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 04:19:04 +0000 |
commit | fb0d1112246a82bc402801b9c224f34558993842 (patch) | |
tree | ded756a6960fc40b6676bbde6bfaa967c40a93c5 /wk5/pset/speller/dictionary.c | |
parent | 7471e4ee9a6bb15f885956546b0b8674fcd01380 (diff) |
Sun, Apr 28, 2024, 9:19 PM -07:00
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r-- | wk5/pset/speller/dictionary.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index c478f2f..2aa7677 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -49,11 +49,11 @@ 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; - for (int i = 0; word[i] != '\0'; i++) - { - val += (word[i] % 26); - } - return val % 26; + // for (int i = 0; word[i] != '\0'; i++) + // { + // val += (word[i] % 26); + // } + return word[0] % 26; } // Loads dictionary into memory, returning true if successful, else false |