7 releases
| new 0.3.1 | Apr 6, 2026 |
|---|---|
| 0.3.0 | Feb 7, 2022 |
| 0.2.4 | Feb 7, 2022 |
#356 in Games
680KB
426 lines
Wordle in Rust
A Rust library and cli for Wordle. Inspired by Wordle in Bash
Install
brew install 64bit/tap/wordler
OR
cargo install wordler
Play
wordler

Basic Library Usage
use wordler::dictionary::EnglishDictionary;
use wordler::wordle::{Wordle, PlayResult};
// You can implement Dictionary Trait for custom dictionaries
let dictionary = EnglishDictionary::new().unwrap();
// Initialize game with a valid dictionary
let mut wordle = Wordle::new(&dictionary);
// Game Turn
let play_result = wordle.play("dream");
// Turn Result
match play_result {
Ok(play_result) => {
println!("{}", play_result);
match play_result {
PlayResult::YouWon(_) => std::process::exit(0),
PlayResult::YouLost(_, _) => std::process::exit(1),
PlayResult::TurnResult(_) => {}
}
}
Err(e) => println!("{}", e),
}
Dependencies
~2MB
~27K SLoC