Nerdle - a nerd's approach to solving Wordle

Overview

Nerdle - a nerd's approach to solving Wordle

alt text

Build

example workflow

Features

  • Solve the game in realtime using Nerdle's solver
  • Simulate how the game would unfold given an answer
  • Evade being discorvered - dodge the guesses for as long as possible

Install

  • pip install git+https://github.com/CatchemAl/Nerdle.git

Commands

  • nerdle solve --guess=SOARE (with an optional starting guess)
  • nerdle simulate --solution=BRAIN (see how the pros solve it)
  • nerdle evade --size=6 (play a devilishly hard game with 6 letters inspired by absurdle)

Algorithm

  • Based on min-max
  • Subject to change
  • Can be improved
  • Is work in progress
Comments
  • Make Solver class covariant generic

    Make Solver class covariant generic

    The introduction of a generic solver simplified the deep solvers materially. However, a few new errors have emerged (undetected for now) when running strict mypy. The engine must declare the generics associated with the solver.

    Solution: make the solver covariant and fix the factory type annotations

    bug good first issue 
    opened by CatchemAL 1
  • Create Directed Graph (a.k.a. Decision Tree) showing the moves Doddle makes

    Create Directed Graph (a.k.a. Decision Tree) showing the moves Doddle makes

    • [x] Expand the benchmarker to return more information
    • [x] Update the Doddle facade to allow for benchmarking
    • [x] Consider creating a HTML repr of the benchmark result object
    • [x] Add a convenience method for creating a directed graph
    • [x] Update packaging to allow for optional dependency on GraphViz
    • [x] Update documentation on how to install GraphViz
    • [x] Update Notebook to show how to benchmark
    • [x] Save SVG in images
    enhancement 
    opened by CatchemAL 1
  • Benchmark test suite has poor execution when parallelized

    Benchmark test suite has poor execution when parallelized

    • Create a SharedMemory buffer to ensure that the large ScoreMatrix class can be shared across processes with copying.
    • Increase chunk size to reduce the overhead of creating new processes
    enhancement 
    opened by CatchemAL 1
  • Integrate with WordleBot

    Integrate with WordleBot

    The wordlebot leaderboard has a csv txt format for uploading your scores.

    1. Ensure that Doddle can write the required format
    2. Ensure Doddle can read the required format and generate a decision tree
    enhancement 
    opened by CatchemAL 0
  • Rename is_common_word to is_potential_soln

    Rename is_common_word to is_potential_soln

    The naming here is not good. is_common_word is used throughout the code as an indication that the word is one of the the two thousand words that could ever be a solution.

    However, the meaning within the code has changed over time and now indicates whether a word is still a potential solution. I.e. is it part of a list of words that shrinks with every iteration.

    Proposal - at all but the highest levels, rename to is_potential_soln.

    enhancement good first issue 
    opened by CatchemAL 0
  • Deep Minimax not conveying depth of levels 3+

    Deep Minimax not conveying depth of levels 3+

    Currently, the implementation of DeepMinimax returns the best depth1 guess associated with worst depth 2 outcome. However, this will not work for depths of 3+. Suppose that at depth 3+, the solver realises it is essential to return some guess, Guess A, at depth 2 in order to avoid major problems. The depth 1 solver would have no idea that it needs to play Guess A because the knowledge learnt at depth three is not being conveyed back up the chain.

    Deep entropy doesn't have this problem because it modifies the guess. This is probably an acceptable workaround although an alternative is that deep guesses have a list (of length n) corresponding to the worst outcome at each depth n.

    bug 
    opened by CatchemAL 0
  • Feature/deeper doodles

    Feature/deeper doodles

    Adding a few methods to simplify search operations. The basic Minimax solver is now a two-liner 🎉.

    • Adding a few operations to simplify the process of finding the best / finding the worst / sorting guesses.
    • Dependency injecting the solver into the DeepMinimaxSolver. This allows for recursive searches of arbitrary depth which is currently controlled in factory.py

    One design decision I thought made sense was to drop the dictionary from the Guess class. The memory footprint is quite large with it as thousands of guesses get generated each holding thousands of words. It also allows for easy structural equality checks which is v useful / required to simplify a few things.

    I copy pasted the DeeperMinimax class and added incorporated the upgrades but removing the dictionary broke version 1. I hope that's ok as v2 started life from v1 but it's tricky to keep backwards compatability. V1 has a couple of optimsations in it that v2 does not have so those still need to be included.

    Returning guess as a class is a dubious design decision on my part as there is a degree of coupling to the minimax philosophy. My feeling is that this will need to change or be abstracted behind a base class of some sort. A protocol is probably the more appropriate abstraction than an ABC here but TBD.

    opened by CatchemAL 0
  • Solver looking at the next iteration

    Solver looking at the next iteration

    Code could benefit from some tidying, but if you want to take a look...

    Look for the top ~5 guesses and evaluate the worst case bucket count for the next guess. Choose the guess with the smallest worst case in the next iteration.

    I can't find a case where this approach follows a different path to the existing solver. Unless there is an issue in the logic I've implemented, potentially the heuristic currently implemented is very good.

    Much slower than the existing approach for two reasons:

    1. Has to solve the next iteration
    2. Has to solve for several potential solutions when looking at the next iteration
    opened by PersonalPete 0
  • Extract a base class of solver

    Extract a base class of solver

    So we can build different concrete solver instances and re-use the rest of the framework.

    I was going to use this branch to have a go at a minimax solver that looks at a second round of guesses, but the structural changes are probably useful to share early.

    opened by PersonalPete 0
  • Bug when playing evade - sometimes fails with two to go

    Bug when playing evade - sometimes fails with two to go

    Because max(...) is not enough when there is only a histogram of ones. Need to choose the histogram bucket that doesn't hold the guess!

    RAISE BLUDY CHUMP CHUCK

    bug 
    opened by CatchemAL 0
  • Make the solve CLI more interesting

    Make the solve CLI more interesting

    Currently the solve CLI is a litttle... sad.

    All the analytics are there, so let's make the UX a bit more fun. Provide more words, associated metrics and the remaining list of potential solutions.

    Hint: sorted(solver.all_guesses()) gives what we need.

    enhancement 
    opened by CatchemAL 0
Releases(1.6.0)
  • 1.6.0(Apr 6, 2022)

    What's Changed

    • Feature/optimal tree by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/28

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.5.0...1.6.0

    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Apr 6, 2022)

    What's Changed

    • Feature/wordlebot by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/25
    • Naming. This closes #20. by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/26

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.4.0...1.5.0

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Apr 6, 2022)

    What's Changed

    • Feature/covariant generics by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/23
    • Feature/decision by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/19

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.3.0...1.4.0

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Apr 6, 2022)

    What's Changed

    • Speed up tests by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/16

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.2.0...1.3.0

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Apr 6, 2022)

    What's Changed

    • Feature/docstrings by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/12
    • Feature/codecov by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/13
    • Update setup.cfg by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/14

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.1.0...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Apr 6, 2022)

    What's Changed

    • Feature/experimental pandas by @CatchemAL in https://github.com/CatchemAL/Doddle/pull/11

    Full Changelog: https://github.com/CatchemAL/Doddle/compare/1.0.0...1.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
null
Wordle Tas Tool is a terminal application for solving Wordle puzzles

Wordle Tas Tool Terminal application for solving Wordle puzzles Wordle Tas Tool (WTT) is a Python script that iterates over SCOWL95 to solve Wordle pu

null 1 Feb 8, 2022
A simple log-frequency helper for solving Wordle puzzles

A Simple Helper for Wordle Basic Usage Clone the repo and run python play.py Select a word from the list, or type your own choice of word Type the sam

Christian Casey 2 Feb 14, 2022
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022
A very bad wordle solver to help me solve the daily wordle

Wordle Solver A very bad wordle solver to help me solve the daily wordle on https://www.powerlanguage.co.uk/wordle/ TODO list take into account letter

Logan Anderson 4 Feb 3, 2022
This is a python implementation of wordle, which uses the same set of available words as the hit game, Wordle

Wordle Game This is a python implementation of wordle, which uses the same set of available words as the hit game, Wordle. Play the game manually pyth

Pierre Theo Klein 11 Mar 4, 2022
Wordle player - A Class that plays wordle optimally

wordle_player A Class that plays wordle optimally if you want to play wordle opt

Andrés Hernández 1 Jan 31, 2022
Wordle - Wordle Clone With Python

Wordle Clone Python This is a cli clone of the famous wordle game developed by J

Shivam Pandya 20 Jul 7, 2022
Wordle-Python - A simple low-key clone of the popular game WORDLE made with python and a 2D Graphics module Pygame

Wordle-Python A simple low-key clone of the popular game WORDLE made with python

Showmick Kar 7 Feb 10, 2022
Wordle - Implementation of wordle and a solver

Wordle - Implementation of wordle and a solver

Kurt Neufeld 1 Feb 4, 2022
Wordle-player - An optimal player for Wordle. Based on a rough understanding of information theory

Wordle-player - An optimal player for Wordle. Based on a rough understanding of information theory

Neill Johnston 3 Feb 26, 2022
Wordle Solver: A simple script which is also called Wordle solver

wordle-solver this code is a simple script which is also called Wordle solver. t

amirreza 1 Feb 15, 2022
Wordle-prophecy - The comprehensive list of all Wordle answers, past and future

About This repo contains the comprehensive list of all Wordle answers, past and

Hayden Moritz 2 Dec 15, 2022
An optimal solution finder for the game Wordle, written in Python

wordle-solver: a nearly-optimal computer player for Wordle Wordle is an interesting word guessing game. This program plays it very well, taking only 3

null 4 Jun 13, 2022
This is a Python solver for the game Wordle, which recently received its PT-BR version

PT_BR_Wordle_Solver Este é um solver feito em Python do jogo Wordle, que recebeu sua versão PT-BR recentemente. Onde jogar Os sites para se jogar mais

Vinicius Jameli 1 Jan 24, 2022
Given some input, spit out the possible words for a Wordle puzzle

Wordle Helper, because why not. Given some input, spit out the possible words for a Wordle puzzle First time setup # Download the dictionary to a file

Richard Duarte 1 Jan 25, 2022
Allows you to email people wordle spoilers. Very beta, not as many features

wordlespoiler Allows you to email people wordle spoilers. Very beta, not as many features How to Use 1.) Make a new gmail account. Go to settings (Man

null 0 Jan 4, 2023
I got bored and wrote a wordle solver... Its pretty good though, just saying

Wordle Solver I got bored and wrote a wordle solver... Its pretty good though, just saying. Please go support Josh and have fun with Wordle on the off

Darrell Best 2 Jan 25, 2022
My goofy little script for playing wordle

my wordle "solver" My goofy little script for playing wordle. It actually runs really slowly at first but once you've added some info (e.g. which lett

MB 3 Feb 4, 2022
This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle

Pyal Telegram Bot This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle. How does it work? Differently from the ori

Rafael Omiya 4 Oct 6, 2022