#ball #magic #original #game #eight #mimics #answer

eight_ball

Mimics the original magic eight ball game

8 releases

0.2.6 Jul 23, 2019
0.2.5 Jul 23, 2019
0.1.0 Jun 17, 2019

#2 in #eight

Apache-2.0

9KB
65 lines

me badge cratesio badge docs badge ci badge

eight_ball

Mimics the original eight magic ball game.

Ask a question and it will reply with an answer...
Also supports predefined custom answers.

Example

use eight_ball::{Answer, AnswerType, EightBall};

fn main() {
    let question = "Am I in charge?";
    let answers = vec![
        Answer::new("UwU.", AnswerType::Affirmative),
        Answer::new("OwO.", AnswerType::NonCommittal),
        Answer::new("Baka No.", AnswerType::Negative),
    ];
    let b = EightBall::with_answers(answers);

    println!("{}", question);
    println!("{}", b.ask(question).unwrap().content);
}

Licence

Apache-2.0

Dependencies

~1.4–2MB
~37K SLoC