Crates.io | roggle |
lib.rs | roggle |
version | 0.7.2 |
source | src |
created_at | 2022-05-12 04:02:54.722531 |
updated_at | 2022-05-20 20:50:21.207872 |
description | A Boggle solver written in Rust! |
homepage | |
repository | https://github.com/parkuman/roggle |
max_upload_size | |
id | 585004 |
size | 4,249,689 |
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.
w o d p
d j i k
a s o p
s a Qu s
use roggle;
use std::collections::HashSet;
fn main() {
let board = "wodp djik asop saqs";
let solutions: HashSet<String> = roggle::solve(board);
println!("{:?}", solutions);
}
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!
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 :)