Giter VIP home page Giter VIP logo

wordle-solver's Introduction

Wordle Solver

Command line solver for the game Wordle

Uses the official NY Times answer list provided by cfreshman

Approach

The underlying mechanism of this solver is a state space search. In particular, I'm utilizing what is essentially a breadth first search.

We examine every possible state in the space of 5 English letter combinations in the worst case, i.e. 26^5 โ‰ˆ 12 million states. That is a pretty large number and is definitely not efficient. As a result, this tool is not going to be the most optimal solver.

However, after a single round or two of the game, enough information is typically gained (by fixing 1+ positions and/or reducing the branching factor) to reduce the search space by 98+%. This means the tool is "good enough", and the possible answers to the day's puzzle can be reduced to just a few words or less.

Usage

Clone the repository. Navigate to the root directory. Run the following command to start the program:

python3 wordle_solver

You will be prompted to enter a guess, followed by the results from the guess using the following rules:

  • Enter k (as in known) for the letters that are correct, i.e. 'green'
  • Enter w (as in warm) for the letters that are in the answer, but in the wrong position, i.e. 'yellow'
  • Enter c (as in cold) for the letters that are not in the answer, i.e. 'gray'

Repeat for as many guesses as you wish to enter.

The program will spit out the answer, or the potential answers if there are multiple given the current information.

License

MIT

wordle-solver's People

Contributors

jakeoeding avatar

Watchers

 avatar  avatar

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.