Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/64bit/wordle-rs
Wordle in Rust
https://github.com/64bit/wordle-rs
Last synced: about 2 months ago
JSON representation
Wordle in Rust
- Host: GitHub
- URL: https://github.com/64bit/wordle-rs
- Owner: 64bit
- License: mit
- Created: 2022-02-06T06:56:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-02T22:20:06.000Z (about 2 years ago)
- Last Synced: 2024-10-13T19:36:27.901Z (3 months ago)
- Language: Rust
- Homepage: https://docs.rs/wordler
- Size: 1.31 MB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wordle in Rust
A Rust library and cli for [Wordle](https://www.powerlanguage.co.uk/wordle/).
Inspired by [Wordle in Bash](https://gist.github.com/huytd/6a1a6a7b34a0d0abcac00b47e3d01513)## Install
```
cargo install wordler
```## Play
```
wordler
```![Play Demo](play-demo.gif)
## Basic Usage
```rust
use wordler::dictionary::EnglishDictionary;
use wordler::wordle::{Wordle, PlayResult};let dictionary = EnglishDictionary::new().unwrap();
let mut wordle = Wordle::new(&dictionary);
let play_result = wordle.play("dream");
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),
}
```