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 didactic GUI chess game made in Python3 using pygame.

Chess A didactic GUI chess game made in Python3 using pygame. At the moment, there is no AI. The only way you can test the game is by playing against

Leonardo Delfino 1 Dec 22, 2021
This a Chess PGN saver which allows you to save your game pgns, in a .pgn file

PGN Saver This a Chess PGN saver which allows you to save your game pgns, in a .pgn file This can be a very useful tool for the people using chessbase

3 Jan 06, 2022
Découvrez CubeCraft Launcher, une application uniquement codé en Python et en Batch

Découvrez CubeCraft Launcher, une application uniquement codé en Python et en Batch. Grâce à son interface graphique facile et intuitive, vous pouvez vous retrouver facilement.

1 May 21, 2022
用于 blivechat 的图形界面

blivechat GUI 用于 blivechat 的图形界面。 有朋友在搞 Vtuber,像 blivechat 类似的项目能通过自定义 CSS 的方式在 OBS 上添加一个非常好看的聊天栏。但是想要在桌面端看到弹幕的话得要再开一个浏览器页面,十分不方便。就想写一个背景透明的浮窗浏览器。 挺喜欢

Silence 11 Dec 29, 2022
Memory game in Python

Concentration - Memory Game Concentration is a memory game written in Python, inspired by memory-game. Description As stated in the introduction of th

Marco Colonna 0 Jul 21, 2022
Implementation of the famous puzle Tower of Hanoi

Tower_of_Hanoi Implementation of the famous puzle "Tower of Hanoi". The setup consists of three pegs (sticks) and a certain amount of discs (in this i

Raffaele Fiorillo 3 Mar 08, 2022
Tictactoe py tkinter canvas - Tic Tac Toe written in Python 3 with tkinter mainly using canvas

Python 3 Tic Tac Toe with tkinter This is a tkinter version of my Tic Tac Toe ga

Bojan Adzic 1 Jan 09, 2022
The Bowling Club (Facebook Game) get all strikes.

TheBowlingClubBot The Bowling Club (Facebook Game) get all strikes. FAQ Q: What is this? A: TheBowlingClubBot is a automation bot with 99.99% guarante

#~Rith 1 Jan 19, 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
A Game of Life implementation in Python

Game of Life in Python (Golipy) Golipy is a simulator of John H. Conway's Game of Life, developed in Python based on the Pygame library. This is a toy

Alber 2 Dec 10, 2021
Pong is one of the first computer games that ever created, this simple

Pong-Game Pong is one of the first computer games that ever created, this simple "tennis like" game features two paddles and a ball, the goal is to de

Lateefah Ajadi 0 Jan 15, 2022
This is a python bot to automate BombCrypto game

This is a python bot to automate BombCrypto game. Logs in to the game, reconnects when needed, closes error warnings, sends heroes to work or home automatically, has Telegram integration and lets you

AFKAPP 39 Sep 28, 2022
Game-of-life - A simple python program to simulate and visualise the Conway's Game of life

Conway's game of life A simple python program to simulate and visualise the Conw

Dhravya Shah 3 Feb 20, 2022
A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame

Self-driving-car-with-Pygame A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame Description A car has 5 sensors ("ey

Henri 3 Feb 01, 2022
Aftermath is an anti token grabber written in Python3.

🎈 Aftermath 🎈 Aftermath is an anti token grabber written in Python3. This tool with a GUI setup is checking the Downloads folder to search for token

Billy 39 Dec 16, 2022
Repository for the DecodED2 Game Project!

DecodED2 Game Project Hello everyone! Welcome to the GitHub Repository for DecodED2, as a start you'll need to clone this repository and make sure you

6 Sep 29, 2021
A Minecraft clone written in python and pyglet.

PyCraft A Minecraft clone written in python and pyglet. Running PyCraft To run PyCraft, run the following code: git clone https://github.com/TheWebCra

The WebCrafters 17 Dec 29, 2022
Overview: copain, your friendly AI framework to learn and play games

Overview: copain, your friendly AI framework to learn and play games Interface fceux with python and run reinforcement learning. Compatibility Current

fcharras 1 Dec 16, 2021
Attempts to solve Wordle-like puzzles.

Attempts to solve Wordle-like puzzles.

cotman 1 Feb 14, 2022
Implementation of the Spider-Man Game

Projeto FPRO FPRO/LEIC, 2021/22 Francisco Campos (up202108735) 1LEIC08 Objetivo Criar um clone do clássico Spider-Man em Pygame... Repositório de códi

1 Dec 24, 2021