Giter Site home page Giter Site logo

This project is a shameless ripoff of the great work done by Yin Ki Ng

Wordle Solvers in Python

Quick Start (Command Line)

Playing a 5-letter Wordle game

In command line, run $ python main.py interactive

The program will guess a first word and let you type the response with the specified format.

Interactively guess a word

Based on your response, the program will pick a new guess word and the process repeats.

Interactively guess a word

Your can also specify a target word by running

$ python main.py interactive --with_target

The program will simulate the guessing process with an automatically generated response to each of its guess.

Simulation

Quick Start (iPython Notebook)

See demo.ipynb.

Wordle Solvers Basic Info

The Heuristic solver

HeuristicWordlePlayer

  • Picks the guess based on character frequencies
  • A word scores higher if it is composed of common characters rather than rare characters
  • The worse and average number of guesses is 6 and ~3.82, with the first guess as "raise"
  • Computes on-the-fly.

The Maximum Information Gain Solver

MaxInformationGainWordlePlayer

  • Picks the guess based on maximizing information gain
  • A word scores higher if it generates the maximum Shannon entropy from its response distribution (the count of all possible response outcomes with respect to the available target words).
  • The worse and average number of guesses is 5 and ~3.65, with the first guess as "react"
  • Computes slower and is optimized by pre-computation
  • Providing a larger word list as the guess list improves the average number of guesses to ~3.60 with the start word as "reast", "trace" etc

More Command Line Options

$ python main.py --solver <solver> --first_guess <first-guess> <mode> <mode arguments>

The <solver> is either heuristic, small-mig, or large-mig. (mig stands for Maximum Information Gain). The default is heuristic.

The <first-guess> specifies a fixed word for the solver to use in the first guess. The default is raise.

The <mode> is either interactive or analysis and the mode arguments are as follows:

  • interactive: (examples as above) guess an unknown target with the manual response from the user, or add --with_target to specify a simulation process.

  • analysis: for analyzing the worst and average number of guesses of the solver.

    Run $ python main.py analysis and the solver will simulate the guessing process for all potential target words using the fixed first guess word (see above to change the first guess word).

    Run $ python main.py analysis --topK <topK> to run the above analysis for the automatically selected top-K first-guess words (that have the highest internal solver score).

    Analysis

    Statistics is saved in the /output folder.

Iamjaco's Projects

aitextgen icon aitextgen

A robust Python tool for text-based AI training and generation using GPT-2.

cedar icon cedar

A habit tracker built using SwiftUI

doccano icon doccano

Open source annotation tool for machine learning practitioners.

docs icon docs

Codecademy Docs is a collection of information for all things code. 📕

druginteractions icon druginteractions

Android app that takes the name of a drug as the input and returns a list of drugs that interact with the input drug along with a description of the interaction and its severity.

drugstandards icon drugstandards

Python tools for standardizing drug names to generic names.

ebook-summarizer icon ebook-summarizer

A tiny python programm to summarize EPUB beooks. A second script allows to read the Summary by Text2Speech from Google.

ebooklib icon ebooklib

Python E-book library for handling books in EPUB2/EPUB3 format -

epub-thumbnailer icon epub-thumbnailer

Script to extract the cover of an epub book and create a thumbnail for it

examples icon examples

Learn to create a desktop app with Python and Qt

firetodo icon firetodo

Simple Todo Application using SwiftUI / Firebase / Redux.

flask-boilerplate icon flask-boilerplate

Boilerplate template for a Python Flask application with Flask-SQLAlchemy, Flask-WTF, Fabric, Coverage, and Bootstrap

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.