Code Monkey home page Code Monkey logo

wordle-advicer's Introduction

Wordle Advicer

A Toy project about Wordle puzzle solver in C++, CUI

Overview

Based on the algorithm explained on 3Blue1Brown's video "Solving Wordle using information theory". Thank you for your great inspiring video! My implementation tries to minimize the expected number of total guesses, without any look-ahead step (simple algorithm).

The word dictionary sorted by the frequencies is fetched from charlesreid1/five-letter-words. Thank you for your hard works!

Install Prerequisites

Please install g++ and cmake to build the project.

apt-get update
apt-get install g++ cmake

Build and Play

To build the project, please run

./build.sh

If the compilation is successfully done, then you can see two binaries ./build/src/play/Play and ./build/src/play/Advice.

Play mode

Wordle game play mode. Please type ./build/src/play/Play on your terminal.

  • You can use a (pretty decent) Wordle advicer by typing 'y' in the beginning.
  • Guess small-case 5-lettered words that are listed in the dictionary.txt.
    • GREEN for exact matches, YELLOW for includes, and DEFAULT color for excludes as we all know.
  • Type "give up" if you want to give up and see the answer word.
  • Type "undo" to undo the latest guess.

Advice mode

Advice mode when you are playing Wordle game externally (e.g., NYT). Please type ./build/src/play/Advice on your terminal.

  • It will provide top-8 word suggestions.
  • You can give the external Wordle game's feedback;
    • The feedback string should contains only small-case alphabets ('a'-'z') and '0', '1', '2'.
    • The number of alphabet letters should be 5.
    • The letters that came after '0' (default) are EXCLUDES, '1' are INCLUDES(YELLOW) and '2' are for EXACT_MATCH(GREEN).
      • For example, the feedback "wo1r2d0s" is valid, the parsed guess is "words" and the result state for each letter is {EXCLUDES, EXCLUDES, INCLUDES, EXACT_MATCH, EXCLUDES}.
  • Type "done" if you finish your game and want to restart or quit the advicer.
  • Type "undo" to undo the latest feedback.

TODO

Several TODO to implement later

  • Conservative mode support.
    • The current mode only tries to minimize the expected number of total guesses.
    • It works poorly, for example if the answer is "sates", then it will suggest "tares" -> "humpf" -> "dates" -> "gates" -> "bates" -> "nates", and you will lose the game.
      • However, if you guess "badge" instead of "dates", then you will not lose even though its expected number of total guesses is larger.
    • The conservative mode will try to finish the game within the 6 steps, more than minimizing the expected number of total guesses.
  • Also, GUI support?
    • I think users who followed this instruction might be comfortable enough in CUI. Low prioritized.

wordle-advicer's People

Contributors

lego0901 avatar

Stargazers

 avatar Jinho Lee avatar

Watchers

James Cloos avatar  avatar

Forkers

hoonji

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.