View Single Post
Old Nov 15th, 2006, 1:47 AM   #6
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
A few problems I can see:
1. Your loop seems to be checking for a match on any letter in any position. If this is how it is supposed to work, then fish should get a score of 1, because of the "s"
2. Your loops for the letter checking should not go to MAXWORDLENGTH, as that is reading past the end of shorter words. The characters after the zero terminator at end of the word (e.g. fish) may be random. Your loop should check to see if the you have reached the end of the word you are looking for (e.g. check guess[z] != 0 in the "z" for loop
3. I don't know what the i loop is for - you break out of it immediately in either case in the first if test, so it doesn't look like it should be there at all.
The Dark is offline   Reply With Quote