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)
uses Entropy to find the best next guess for Wordle, given the color clues

WordleSolver uses Entropy to find the best next guess for Wordle, given the color clues use player.py and enter in the string for the suggested clue w

Steve Earth 1 Jan 26, 2022
Tic-Tac-Toe Game in python3 Tkinter

Tic Tac Toe Tic-Tac-Toe Game in python3 Tkinter About: Tic Tac Toe or Noughts and Crosses as called in British is a pencil and paper game for two play

Sai Swarup Yakkala 5 Nov 06, 2022
Sukoku-solver Python About Sudoku is one of the most popular puzzle games of all time

Sukoku-solver Python About Sudoku is one of the most popular puzzle games of all time. As a logic puzzle, Sudoku is also an excellent brain game. Bein

Harshith VH 1 Nov 20, 2021
The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on the spaceship.

Astronomia: let the exploration begin The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on t

Aryan Nath 8 Nov 18, 2022
3D online shooter written on Panda3D 1.10.10 and Python 3.10.1

на русском itch.io page Droid Game 3D This is a fresh game that was developed using the Panda3D game engine and Python language in the PyCharm IDE (I

Marcus Kemaul 5 Jun 04, 2022
Dota2 AI bot - Last Order Dota2 Solo AI

Last Order Dota2 Solo AI 该库提供一个由强化学习训练出的Dota2影魔solo智能体。该智能体通过自我对战的训练方式训练,从随机动作开始学习复杂的策略。玩家可以与该智能体进行影魔solo对战。 对战规则 1.物品方面不可以出凝魂之露,灵魂之戒,魔瓶,真眼。 2.不可以吃符,或

bilibili 365 Jan 05, 2023
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
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
Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI.

Ultimaze Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI. La consigne était d'utiliser la librairie pygame pour créer un jeu en

parlabarbedeMerlin 3 Sep 17, 2022
Brawl Stars open source server for v20

Laser Scratch Brawl Stars open source server for v20! Implemented Features Battle End Leaderboard Player Profile Lobby Info Menu Notifications Club Wa

TheIke 17 Nov 19, 2022
A python script to solve Wordle puzzles

Wordle solver A python script to solve Wordle puzzles.

Felix Weinberger 1 Feb 12, 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
Console 2D GameEngine {C2DGE} [0.1.0]

Console 2D GameEngine {C2DGE} [0.1.0] By Grosse pastèque#6705 The Project's Goal : This projects was just a challenge so if you have bad reviews, it's

Big watermelon 1 Nov 06, 2021
A Higher-Lower web game made in Python using Flask framework.

Higher Lower Web Game Guess the random number from 0 to 9 in this web game made with Python and Flask Framework Modules that were used Random Flask In

Yago Goltara 1 Oct 27, 2021
A little python script for finding the best word choice in a Wordle game

A little python script for finding the best word choice in a Wordle game, by assuming that at each step you want to minimise the average number of possible answers left after guessing that word (note

zeb 26 Mar 16, 2022
Fully functional BlackJack game with a graphical user interface.

BlackJack Welcome to BlackJack! This game is fully functional, with a casino sound package integrated using Pygame, dynamic game logic developed using

Shwetang Desai 2 Jan 10, 2022
Code and outputs from analysis determining that the wordle game can always be won in six moves.

wordle_worst_case_analysis Code and outputs from analysis determining that the wordle game can always be won in six moves. This is for the general cas

2 Aug 19, 2022
DouZero_For_HLDDZ_FullAuto: 将DouZero用于欢乐斗地主自动化

DouZero_For_HLDDZ_FullAuto: 将DouZero用于欢乐斗地主自动化 本项目基于DouZero 和 DouZero_For_Happy_DouDiZhu 环境配置请移步项目DouZero 模型默认为ADP,更换模型请修改main.py中的模型路径 运行main.py即可 在原

322 Dec 25, 2022
Building a Mario-like, classic platformer game in Python using the PyGame Library

Building a Mario-like, classic platformer game in Python using the PyGame Library

Clarence Vinzcent Reyes 1 Feb 06, 2022
Online battleships game on python and JS

Battleships Online battleships game Using websockets to connect to the client. SQLite database for storing account data and game logs (for players top

5 Nov 11, 2021