Package: wordle-utils
Wordle UtilsHelper functions, word lists, and analysis tools for Wordle and other Wordle variants.Installationpipinstallwordle-utilsBasic UsageTo run a bot that solves wordle for you, just run the following from your terminal after installing the package:solve_wordleThe bot will output guesses, input what the "result" of those guesses is._is a miss/blank,!is a correct/green, and?is a wrong spot/yellow letter.Advanced UsageThis library can be used for more than just solving wordle automatically.AnalysisTo see how many words were possible after a series of guesses use thewhat_do_i_knowfunction. This takes the actual answer as well as some guesses that were made and returns the possible words after those guesses. This can be useful after completing the Wordle puzzle to see how well you narrowed down the possible word list.In this example, the actual answer word was ROBOT. The two guesses made were LATER and TROUT. You can see that after these two guesses the only possible words remaining were ROBOT and WORST.fromwordle.analysisimportwhat_do_i_knowwhat_do_i_know('robot','later','trout')# ['robot', 'worst']Library FunctionsThis library has some helper functions you can use in your own scripts. These will work for most Wordle variants.ResultThis library includes aResultenum (wordle.core.result.Result) for possible results of a guess. A result can be a miss, wrong spot, or correct. In most functions you can replace the enum with the shorthand string version of a resultResult.correct/'!'- the letter appears in this exact spot in the answerResult.wrong_spot/'?'- the letter appears somewhere else in the answerResult.miss/'_'- the letter does not appear in the wordThere is some interesting behavior when guesses or answers contain duplicate letters. Thetest casesshould give you a better idea of these. The behavior is meant to mimic the behavior of the actual Wordle game.get_resultGiven a guess and a known answer, return the "result" of the guess. This will be an array ofResultobjects.For example, if the answer was ROBOT and the guess was TROUT:fromwordle.core.gameplayimportget_resultget_result('trout','robot')# [Result.miss, Result.wrong_spot, Result.wrong_spot, Result.miss, Result.correct]filter_word_listGiven a starting list of words, return a new filtered down word list based on a guess and its result. You can use this function to whiddle down a word list as more guesses and results are learned.For example, assume the remaining words were CLAIM, EMAIL, IMAGE, and SIGMA. The player guessed STAIN and got a result of__!!_.fromwordle.core.gameplayimportfilter_word_listwords=['claim','email','image','sigma']new_words=filter_word_list(words,'stain','__!!_')# ['claim', 'email']VariantsThis library supports Wordle variants as well, since many of the gameplay strategies and functions are the same.Mathler/NerdleThese are both math based variants of Wordle where rather than guessing words you are guessing equations or expressionsMathler- the target answer is given to you, find an expression that equals it. Comes ineasyandhardvariants as well.Nerdle- you provide a full 8-digit equation, expression on one side, an equals sign, and then the result on the other side.To have the solving bot play either of these games, call their solve methods# Play Mathler (normal mode) with a target number of 314fromwordle.play.mathlerimportplay_mathlerplay_mathler(314)# Play Nerdlefromwordle.play.mathlerimportplay_nerdleplay_nerdle()