更新时间:2022-06-26 06:18:24
while(i < this.puzzleWords.size())
你正在尝试每一个单词。
在你现有的while循环中添加另一个while循环,定义为在找到位置时结束:
you are trying each word once.
add another while loop inside your existing while loop, defined to end when the position is found:
while(i < this.puzzleWords.size()) { // each word
while(positionNotFound){ //search until...
// your code
// .....
//....
if(positionFound){
break; //leave inner while
}
}
}