Git Product home page Git Product logo

letterboxed's Introduction

LetterBoxed solver

This project is a Go implementation of a solver for the LetterBoxed puzzle from the New York Times. The solver constructs a trie from a dictionary of valid words and finds all possible solutions that match the puzzle's constraints.

Features

  • Trie-based Word Storage: Efficiently store and retrieve words using a trie.
  • Puzzle Graph Construction: Build a graph of valid words that fit the puzzle's letter constraints.
  • Solution Finding: Find all possible solutions, with options to print hints using external APIs.

Installation

Clone the repository:

git clone https://github.com/os12345678/letterboxed.git
cd letterboxed

Install dependencies:

go get ./...

Usage

Command-Line Arguments

--puzzle (default: mrf-sna-opu-gci): Puzzle input in abc-def-ghi-jkl format.
--dict (default: words.txt): Path to a newline-delimited text file of valid words.
--len (default: 3): Maximum length, in words, of solutions.
--hint (default: false): Print a hint using external vocabulary APIs.

Running the solver

go run cmd/letterboxed/main.go --puzzle="mrf-sna-opu-gci" --dict="words.txt" --len=3 --hint

Environment Variables for Hints

To use the hint feature, set the following environment variables with your API keys:

BigHugeLabsApiKey
WordnikApiKey

Example

export BigHugeLabsApiKey="your-bighugelabs-api-key"
export WordnikApiKey="your-wordnik-api-key"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.