Code Monkey home page Code Monkey logo

optimalwordlesolver's Introduction

Perfect Wordle Solver

Uses an optimized brute-force search to find strategies for wordle with the minimum possible average game length. From it's computation, the optimal starting word is "salet", and the optimal average game length is 3.4223.

There are two included solution files, "2309_solution.txt", which contains the strategy for the case where only solution words are guessable, and "full_solution.txt", which contains the strategy using all guess words. On a single core, the former takes three minutes and 2.5 gigabytes of memory, while the latter takes and hour and 10 minutes and about 20 gigabytes of memory. I have not yet implemented any interface for interacting with these solution files, so for now searching through them with control-f works.

How it works

The core idea behind this program is that we don't have to spend any time on a guess word if we know it to be worse than the best guess word. To that end, the program begins by computing a lower bound of the game length after each guess, by finding a weighted average of the minimum game length after each hint. It then repeatedly increases the lower bound of the guess with the lowest lower bound by applying the same process to one of the resulting lists of words after the best guess and a hint, doing this recursively if necessary. In this way, it spares a huge amount of computation by only spending time searching the word it thinks to be the best each iteration.

optimalwordlesolver's People

Contributors

nkoppel avatar

Watchers

 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.