View Single Post
Old Nov 16th, 2006, 1:17 AM   #19
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
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.
The Dark is offline   Reply With Quote