Git Product home page Git Product logo

wordlebuster's Introduction

Wordle guesser

This is a python script I threw together to algorithmically solve games of wordle.

Some may call this cheating. To that I say it certainly attempts to be more effective than human memory of words, but also you can just look up the answer on google, which is even less educational.

Coincidentally, the literal day after I wrote this, 3blue1brown posted a video that goes into way more math and essentially does the same thing as this script, but obviously way better since I hacked this together in a few hours.

How to use

  1. Check which wordlist is being used in the script (its around lke 42). See the wordlists section below for the possible options.
  2. run python3 wordlebuster.py
  3. enter the word it tells you to as your wordle guess and then type in the result into the script by entering a 5 character string of C X or M to represent Correct, eXcluded, or Misplaced letters.
  4. the script will give you another word to try.
  5. repeat. typing in CCCCC (or stopping it early with Ctrl-C) will cause the script to exit.

I havent tested this as thoroughly or with as many fancy simulations as 3blue1brown did, but it seems to do pretty well (3-4 rows) most of the time.

Wordlists

This script comes with a couple different wordlists:

  • wordle_solutions is the short (~2k words) list of all the words that could possibly be wordle answers. some consider this cheating.
  • wordle_all is the wordle_solutions list combined with the other list of valid words (~13k words) from the wordle source code
  • wordmaster is the wordlist from the source code of the open source word-master app that was also used for testing because of the lack of a 1-puzzle daily limit
  • all_words is a (deduplicated) combination of all of the above lists if you want the most generic possible experience

there are definitely more wordlists/datasets that can be added. If you add any, please feel free to make a contribution.

Wordle game variations and other links

While developing this, I found a number of wordle clones that may be useful:

There is also an android pattern lock version of the game and an awesomelist for wordle already.

wordlebuster's People

Contributors

moralcode avatar

Watchers

James Cloos avatar  avatar  avatar

wordlebuster's Issues

find some way to prioritize words when there are no useful hints

as is, the script doesnt really know what to do once it has correctly located al of the "misplaced" letters.

i.e. in the scenario where all but one letter is correctly placed, it will basically just run through the alphabet (at least the letters that make a valid word) one by one. This will basically mean that you will lose if you have a limited number of guesses unless theres a way to rank words without any additional info (like letters that are misplaced)

add a mechanism to filter words that dont exist

maybe by entering something like INVALID will cause that word to be removed and a new guess to be generated.

this will be useful when using combined wordlists that may have more words than the list for the game you are playing.

Add a check to make sure that letters arent excluded when they appear multiple times

example from wordbuster:
Screenshot_20220205_132545

word: BUNNY

output(using the wordbuster list):

The best first guess is: adieu
Your next word to guess is: adieu
what did this word score? Enter C if the character was correct, X if it is wrong, and M if it was misplaced:XXXXM
Your next word to guess is: bubus
what did this word score? Enter C if the character was correct, X if it is wrong, and M if it was misplaced:CCXXX
Traceback (most recent call last):
  File "wordlebuster.py", line 182, in <module>
    update_hints(user_input, guess_word)
IndexError: list index out of range

for the bubus guess, the "b" was marked as both C and X in different positions. causing the logic to break

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.