Wizdle

Wizdle

Build & Test Solve Wordle Today Mutation testing badge NuGet Downloads

πŸ”­ High Level

A library for solving Wordle.

Simple Flow:

---
config:
  theme: redux-dark
  look: handDrawn
  layout: fixed
---
flowchart LR
    CORRECT["Correct Letters"] --> REQUEST["Request"]
    MISPLACED["Misplaced Letters"] --> REQUEST
    EXCLUDE["Excluded Letters"] --> REQUEST
    REQUEST --> ENGINE["Engine"]
    ENGINE --> RESPONSE["Response"]
    RESPONSE --> WORDS["Possible Words"]

Prerequisites

Prerequisite Note
.NET10 SDK .NET10 or greater required.
Check current .NET version dotnet --version.
Download .NET10 here.
Docker Download Docker here.

πŸ§™ Wizdle

The Wizdle core library found here, is responsbile for translating the request into a list of possible Words.

Example

var wizdleEngine = new WizdleEngine(logger);

var request = new WizdleRequest
{
    CorrectLetters = "....t"
    MisplacedLetters = "..rs.",
    ExcludeLetters = "haebu",
};

WizdleResponse response = wizdleEngine.ProcessWizdleRequest(request);
// response.Words: ["skirt", "snort", "sport"]

Package

Available on:

πŸ’» Wizdle.Console

The Wizdle Console application allows us to access all the functionality of the Wizdle library via the CLI.

More information can be found here

Example

Command:

$ ./Wizdle.Console.exe solve --correct "....t" --misplaced "..rs." --exclude "haebu"

Response:

Processing WizdleRequest: CorrectLetters: "....t"   MisplacedLetters: "..rs." ExcludeLetters: "haebu"
Mapping WizdleRequest:    CorrectLetters: "....t"   MisplacedLetters: "..rs." ExcludeLetters: "haebu"
Mapped SolveParameters:   CorrectLetters: "????t"   MisplacedLetters: "??rs?" ExcludeLetters: "haebu"
Found 3          Word(s) matching the criteria.
Found 3 Word(s) matching the criteria.
skirt
snort
sport

πŸͺŸ Wizdle.Wpf

The Wizdle WPF application allows us to access all the functionality of the Wizdle library via a GUI on Windows.

More information (and installers) can be found here.

Wizdle.Wpf

πŸ“¨ Wizdle.Api

The Wizdle Api Service contains a deployable API instance of the Wizdle library.

More information can be found here

🎯 POST

Summary: Processes a Wizdle request in an attempt to solve the possible words.

Request

Content-Type: application/json

Body Parameters

Name Type
correctLetters string
misplacedLetters string
excludeLetters string

Example:

{
    "correctLetters": "a__le",
    "misplacedLetters": "t",
    "excludeLetters": "xyz"
}

Response

Status Code: 200 OK

Body

Name Type
messages array of string
words array of string

Example:

{
    "messages": ["Found 2 Word(s) matching the criteria."],
    "words": ["apple", "angle"]
}

πŸ“² Wizdle.Web

The Wizdle Web contains a deployable Blazor web app instance of the Wizdle library (hosted on the new dotnet Aspire platform & Docker).

More information can be found here

Wizdle.Web Screenshot

πŸ€– Wizdle.Discord

A Discord bot hosting all the functionality of the Wizdle library, users can integrate the bot into their Discord servers.

Invite link for Discord.

πŸ§ͺ Testing

βš™οΈ Make

This project includes a Makefile to simplify common development tasks. Run make help to see all available commands.

Available Commands

Command Description
make help Show all available make commands
make build Build the entire solution in Release mode
make test Run unit and integration tests
make build-api Build the Wizdle.Api Docker image
make build-web Build the Wizdle.Web Docker image
make build-discord Build the Wizdle.Discord Docker image
make build-all Build all Docker images (api, web, discord)
make compose Start all services using docker-compose in detached mode
make stop Stop all running Docker containers
make stop-volumes Stop containers and remove associated volumes
make logs Show and follow logs from all Docker containers
make restart Stop containers, rebuild all images, and restart services
make clean Clean build artifacts and prune all Docker resources
make docker-prune Prune unused Docker resources (images, containers, volumes)
make trust-cert Trust the .NET HTTPS development certificate
make token Generate a random 32-character token for API keys
make mutation Run Stryker mutation testing
make aspire Update Aspire tooling to latest version
make playwright Install Playwright browsers
make solve Attempts to solve Wordle using Wizdle
make test-functional Run all functional tests
make test-all Run all tests (unit, integration, functional, solve)

Quick Start

  1. Build the solution:

     make build
    
  2. Run tests:

     make test
    
  3. Generate tokens for your .env file:

     make token
    
  4. Build all Docker images:

     make build-all
    
  5. Start all services:

     make compose
    
  6. View logs:

     make logs
    
  7. Stop services:

     make stop
    

TL;DR for the TL;DR

Lyndon, did you just spend all this time working on a tool to cheat wordle… rather than actually just solving the word?!