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)
It just a cli based snake game written in Python.

Snake Game in Python Things that I learned in this project: OOP in Python. Clean code. The curses library. How to run the game You need to clone this

Kevin Marques 7 Oct 01, 2022
A basic quiz game using Python

QuizGame A basic quiz game using Python Passwords for quizzes (NO CAPS LOCK!): -ryzermattishandsome -canisleepwithyou Before using this, please make s

Austin 1 Nov 12, 2021
a simple keyboard game

Maxwell-Demon-Game Powered by Taichi. a simple keyboard game This is hw2 of Taichi course, as a basic exercise of class. Rigid 2d bodies and resolve c

8 Feb 01, 2022
My first Minecraft CPU. Created in collaboration with Peer Carnes as a final project in CS 281: Architecture and Assembly at the University of Puget Sound

Minecraft CPU This is my first ever Minecraft CPU, created in collaboration with Peer Carnes. We created a custom assembly language, including an asse

Andy Chamberlain 4 Oct 10, 2022
Flappy bird using Pygames

flappy-bird Esse é um jogo que eu fiz utilizando a biblioteca de jogos do Python

Leandro Henrique 2 Jan 05, 2022
Easily manage wine prefixes in a new way. Run Windows software and games on Linux

Bottles Easily manage wineprefix using environments Documentation · Forums · Telegram group · Funding 📚 Documentation Before opening a new issue, che

Bottles 4.1k Jan 09, 2023
Mastermind-Game - A game to test programming and logical skills

Bem vindo ao jogo Mastermind! O jogo consiste em adivinhar uma senha que será ge

Marcelo Daros 0 Jan 27, 2022
Creating Tetris with Pygame

Tetris 🤝 Contributing Contributions, issues and feature requests are welcome! Feel free to check issues page. Show your support Give a ⭐️ if this pro

Gavin Capriola 0 Mar 01, 2022
PyCraft - A Minecraft launcher made in python

A Minecraft launcher made in python. The main objective of this launcher is to enable players to enjoy minecraft (especially those without a mojang/microsoft account). This launcher is not illegal as

38 Dec 12, 2022
Minesweeper clone with 3 modes of difficulty, UI scaling and custom games feature.

Insect Sweeper Minesweeper clone with 3 modes of difficulty, UI scaling and custom games feature. Mines are replaced with random insects that a player

Piotr Data 1 Nov 05, 2021
Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI

Snake_PEWSAPI Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI And we are not going to make any change to the original Snake sour

Azuki 1 Mar 17, 2022
Brawl Stars private server for version 30.242

Brawl Stars v30 Brawl Stars v30.242 server emulator written in Python. Requirements: Python 3.7 or higher pymongo dnspython colorama Running the serve

15 Oct 17, 2021
Navicella cavallo, gioco 2D stile space shooter

Navicella Cavallo Il miglior gioco in circolazione Navicella cavallo è un gioco 2D basato sullo stile dei giochi space shooter Come installare Navicel

Matteo 6 Jul 03, 2022
Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time

Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time. I made a code to play the game right in your terminal/console. This isn't made to be a game w

1 Feb 15, 2022
A fun, casual and strategic game made using Python!

Steve's Pixels A fun, casual and strategic game made using Python! Prerequisites See requirements.txt Demo video demo.mp4 Usage python -m steves_pixel

Jaivardhan Bhola 9 Sep 17, 2022
Launch any Heroic-Games-Launcher game using bash scripts without having to open Heroic.

HeroicBashLauncher Ever wanted to launch your EGS games installed through Heroic Games Launcher directly from the terminal, Lutris or any other fronte

288 Dec 27, 2022
A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras.

dinoGame A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras. Installation Download

1 Oct 26, 2021
A small, Pygame-based library project intended for personal use.

EzyGame Version 0.0.1 A simple library project intended for personal use with Pygame. Warning: I am a very amateur programmer, so the code will probab

Dorbell 1 Jan 08, 2022
An old time game Tic-Tac-toe

A Tic Tac Toe Bot This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famou

Jigyanshu 0 Feb 25, 2022
A project to san the internet of all open Minecraft servers.

MC-Server-Finder A project that scans the internet to find open Minecraft servers. Install the dependencies by running pip install -r requirements.txt

drakeerv 8 Mar 12, 2022