summaryrefslogtreecommitdiff
path: root/wk5/pset/speller/dictionary.c
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r--wk5/pset/speller/dictionary.c8
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;
}