Skip to content

Commit 42712c8

Browse files
committed
Fix a bug where words that have been confirmed to have a letter in the wrong place are not excluded
thanks deepl
1 parent 971008e commit 42712c8

File tree

1 file changed

+4
-0
lines changed
  • src/main/java/vip/floatationdevice/wordlehelper

1 file changed

+4
-0
lines changed

src/main/java/vip/floatationdevice/wordlehelper/Common.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.awt.*;
44
import java.io.*;
55
import java.util.ArrayList;
6+
import java.util.Iterator;
67
import java.util.regex.Pattern;
78

89
public class Common
@@ -78,6 +79,9 @@ public static void calculatePossibleWords(String inputWord, int[] result)
7879
//keep the words that have the char
7980
ArrayList<String> temp = new ArrayList<String>(2000);
8081
for (String word : answerWordsList) if (word.contains(inputWordLower.charAt(loc)+"")) temp.add(word);
82+
//and remove the words that have the char in this location
83+
for(Iterator<String> it = temp.iterator(); it.hasNext();)
84+
if (it.next().charAt(loc) == inputWordLower.charAt(loc)) it.remove();
8185
answerWordsList = temp;
8286
break;
8387
}

0 commit comments

Comments
 (0)