JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q48527F
  • License MIT

A Rust Boggle solver compiled to WebAssembly!

Package Exports

  • roggle
  • roggle/roggle.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (roggle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

roggle logo

🦀 roggle 🔡

A Boggle Solver Written in Rust and compiled to WebAssembly!

crates.io

Rust Crate | Web Demo

About

Have you ever been playing Boggle and wished you could know all the solutions on the board? Wish no longer! Roggle is a Rust-based package that allows you to solve any N x M Boggle board.

Simply pass in an N x M board as a string with rows separated by spaces. For the Qu tile put q as the letter.

Installation

npm i roggle

Example Usage

Board

 w  o  d  p
 d  j  i  k
 a  s  o  p
 s  a  Qu s

Code

import init, { solve } from "roggle";

function solve_board() {
  const board = "wodp djik asop saqs";
  console.log(solve(board));
}

init().then(solve_board);

Under the Hood

Roggle is a Rust-based Boggle solver compiled to WebAssembly, allowing us to run it in the browser! For more info on the actual Rust implementation, check out the roggle crate on crates.io.

Roggle uses a Trie to breakdown the english dictionary into an easily searchable tree. It then recurses over each board tile, searching all neighbours for possible words until it finishes!

Dictionary

The dictionary used is a 466k word english dictionary. Some words are not super common (aaaa is a word apparently??), but Roggle would rather show you all possibilities then leave you in the dust with less points!

As with any game of boggle, feel free to argue which words are legal with your friends :)