This was a fun little sideproject during the wordle hype were I tried to crack wordles at a 100% success rate.
- generate your dictionary lists in your main function
globalDict = generateDictionaryOfWordLengthX(5, "dictionary.txt");
ArrayList<String> dict = generateDictionaryOfWordLengthX(5, "dictionary.txt");
-
generate a random solution of words in your dictionary (solution is a static field in the class so you can directly set it - this subject to change)
solution = generateRandomSolutionWord(dict);
-
create a attempts loop and break if the solution is found, evaluate your word with evaluateWord(): `for(int attempts = 6; attempts > 0; attempts--) { guess = YourGenerateAGuessFunction
if(guess.equals(solution)) { break; } letterColor[] correctLetters = evaluateWord(guess); } `
-
We are using a find Matching words function.