|
Your function is returning as soon as it finds a word that does not match guess.
What it needs to do is return as soon as it finds a word that matches guess and return false. Return true if you drop out of the loop by reaching the end of the list.
So change your != 0 to == 0 and your true to false and your false to true.
Also, you should be looping up to nWords, not MAXWORDS as there is no reason to rely on your input file containing exactly 8000 words.
|