wordler

Crates.iowordler
lib.rswordler
version0.3.0
sourcesrc
created_at2022-02-07 01:45:21.637983
updated_at2022-02-07 07:33:05.351864
descriptionLibrary and cli for Wordle
homepagehttps://docs.rs/wordler
repositoryhttps://github.com/64bit/wordle-rs
max_upload_size
id528117
size839,017
Himanshu Neema (64bit)

documentation

README

Wordle in Rust

A Rust library and cli for Wordle. Inspired by Wordle in Bash

Install

cargo install wordler

Play

wordler

Play Demo

Basic Usage

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),
}
Commit count: 35

cargo fmt