Roggle is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install roggle
It will make the roggle command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall roggle uninstalls.
Adding roggle library as a dependency
Run this command in a terminal, in your project's directory:
cargo add roggle
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
roggle = "0.7.2"
The roggle library will be automatically available globally.
Read the roggle library documentation .
Back to the crate overview .
Readme
🦀 roggle 🔡
A Boggle Solver Crate!
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 crate 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.
Example Usage
Board
w o d p
d j i k
a s o p
s a Qu s
Code
use roggle;
use std:: collections:: HashSet;
fn main ( ) {
let board = " wodp djik asop saqs" ;
let solutions: HashSet< String > = roggle:: solve( board) ;
println! ( " {:?} " , solutions) ;
}
Under the Hood
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 :)