I posted a thread not too long ago about a word comparison program I was writing, but it vanished pretty fast, and now i have another problem/question.
Using this code, the program tries to find if a word (wordlist) can be made using the letters inputted by the user (letterlist). What I am wondering is, should it matter what order the user inputs the letters in, because apparently it does.Code:while (x <= wordlength) { if (wordlist[x] != letterlist[y]) { y++; if (y == inputlength + 1) { Positive = false; x = wordlength + 1; } } else { ++x; Positive = true; }//close else statement }
When I put in the word lunacy I get the following output:
lac
lacy
lay
lucy
luna
lunacy
lunn
naa
nay
lay
And when I put in ycanul (lunacy backwards) i get this output:
aal
ann
annul
cal
call
can
caul
cull
nul
null
ull
yan
all



LinkBack URL
About LinkBacks



