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)
A tool for the creation of rooms used in maps in the game Wastelands

Wastelands Room Data editor A tool for the creation of rooms used in maps in the game Wastelands Creates .wrd files, that get loaded by the map genera

Avant 6 Jul 12, 2021
Practice the use of the random library to get the user guess the result.

Guessing Game Practice the use of the random library to get the user guess the result. Additional description about the project and its features. Buil

Herbert Orellana 1 Dec 13, 2021
This is the card game like HearthStone and Magic

Territory War How to use it use pip3 to install django and channels: pip3 install Django pip3 install channels go to CardGame/first/consumers.py and g

Caesar 3 Oct 24, 2022
A simple game with the main idea to be: Guess The Number

GuessTheNumber GuessTheNumber is a simple game I made using Python. The main mechanic of the game is to guess the number that randomly generated from

0 Jun 24, 2022
PyGame-Tutorial - Refrence for building games in pygame

PyGame-Tutorial How to build games using the python library PyGame End result Ho

St. Mark's Computer Science Club 2 Jan 09, 2022
The DOS game from the 80s re-written in Python from Scratch!

Drugwars The DOS game from the 80s re-written in Python from Scratch! Play in your browser Here Installation Recommended: Using pip pip3 install drugw

Max Bridgland 45 Jan 03, 2023
A program to read, edit, and write save files for the game Railroads! Online

RROSE - v0.3.6 This program is intended to be used as an external tool to Railroads Online server hosts. It will read save files, allow to modify entr

17 Dec 09, 2022
A popular children's game developed in Python.

Pedra Papel e Tesoura Um dos jogos mais populares da infância... 🪨 📜 ✂️ 💻 Situação do projeto: Projeto finalizado ✔️ 🛠 Tecnologias: Python Tkinter

Arthur V.B.S. 2 Dec 05, 2022
Tic tac toe game developed by naman in python

TIC TAC TOE GAME DEVELOPED BY NAMAN IN PYTHON . IT USES MINMAX ALGORITHM TO COMPETE IN DIFFICULTY MODE

Naman Anand 4 Jun 24, 2022
AI based assitant for minecarft

Minecraft_AI_assistant AI-based assistant for Minecraft There are 4 steps to build 1-I'm using collecting_data.png as a structure to take shots with c

Murat Ali Avcu 13 Oct 16, 2022
Simple python 3D vector3 math library wrapping some types from GLM library using pybind11.

vmath Simple python 3D vector3 math library wrapping some types from GLM library using pybind11. Description Both pure python version and C++ version

6 Aug 02, 2022
A small script to help me solve Wordle because I'm that lazy

Wordle Solver A small script to help me solve Wordle because I'm that lazy. Warning: I didn't write this to be efficient nor elegant at all, so you'll

K4YT3X 3 Feb 11, 2022
CTF (Capture The Flag) started from DEFCON CTF, a competitive game among computer security enthusiasts

CTF Wiki 中文 English Welcome to CTF Wiki! CTF (Capture The Flag) started from DEFCON CTF, a competitive game among computer security enthusiasts, origi

CTF Wiki 6.4k Jan 03, 2023
WIP python/pygame 2D zombie shooter

2d-shooter project A single/multiplayer co-op survival small space zombie shooter. If you'd like to contribute, feel free to join the discord! INSTALL

36 Dec 08, 2022
Este repositorio es creado con el fin de brindar soporte a las personas que están en el proceso de aprendizaje MISIONTIC 2022 en la universidad de Antioquia

Este repositorio es creado con el fin de brindar soporte a las personas que están en el proceso de aprendizaje MISIONTIC 2022 en la universidad de Antioquia. Hecho por los estudiantes para los estudi

Andrés Mauricio Gómez 11 Jun 22, 2022
Inflitator is a classic doom and wolfenstein3D like game made in Python, using the famous PYGAME module.

INFLITATOR Raycaster INFLITATOR is a raycaster made in Python3 with Pygame. It is a game built on top of a simple engine of the same name. An example

Zanvok Corporation 1 Jan 07, 2022
Utility to find games owned by all (or at least some) of the passed players.

SteamCommonGameFinder Utility to find games that are owned by all (or at least some) of the players you pass into this programm. You can already find

Daniel O'Grady 4 Jan 04, 2022
A simple python script to pregenerate minecraft worlds.

mcloady mcloady is a lightweight python script used to pre-generate Minecraft terrain using MCRcon and carpet mod (optional). Inspired by Pre-Generati

5 Dec 08, 2021
Minimalistic generic chess variant GUI using pyffish and PySimpleGUI, based on the PySimpleGUI Chess Demo

FairyFishGUI Minimalistic generic chess variant GUI using pyffish and PySimpleGUI, based on the PySimpleGUI Chess Demo. Supports all chess variants su

Fabian Fichter 6 Dec 20, 2022
This is a two player snake game

Trake This is a two player snake game How to play the game There is food and two players. You try to eat food to become large and gain points. Player

Grrub 1 Dec 19, 2021