diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 03:59:57 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 03:59:57 +0000 |
commit | f6fba277514a7aec1f7d078fd1b4c2ab8b538587 (patch) | |
tree | a2e87e8e823d9711aeebcf04194ce3212ba146d5 /wk5/pset | |
parent | 854530dbb95941f2aa380b1cb3631b5ac3e87fda (diff) |
Sun, Apr 28, 2024, 8:59 PM -07:00
Diffstat (limited to 'wk5/pset')
-rw-r--r-- | wk5/pset/speller/dictionary.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 82f605a..615b3ba 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -48,6 +48,14 @@ 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 i = 0; + char *spill[LENGTH]; + strcpy(spill, word); + while (spill[i] != "/0") + { + val += (word[i] % 26); + } return word[0] % 26; } |