Skip to content

Commit

Permalink
some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikwilkowski committed May 1, 2024
1 parent f3e224b commit 0314fad
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/bot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
//! The bot trait [BotInterface] and a couple types that help with the bot
//! implementation
//! implementation.
//!
//! ```rust
//! use coup::bot::BotInterface;
//!
//! pub struct MyBot;
//!
//! // The minimal implementation of a bot with the StaticBot default trait methods:
//! impl BotInterface for MyBot {
//! fn get_name(&self) -> String {
//! String::from("Kate")
//! }
//! }
//! ```
use crate::{Action, Card, History, Score};

Expand Down
25 changes: 25 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
//! # Coup
//! This is an engine for the popular card game [coup](http://gamegrumps.wikia.com/wiki/Coup).
//!
//! ```rust
//! use coup::{
//! bots::{HonestBot, RandomBot, StaticBot},
//! Coup,
//! };
//!
//! let mut coup_game = Coup::new(vec![
//! Box::new(StaticBot),
//! Box::new(HonestBot),
//! Box::new(RandomBot),
//! Box::new(StaticBot),
//! Box::new(RandomBot),
//! Box::new(HonestBot),
//! ]);
//!
//! // You can play a single game
//! coup_game.play();
//!
//! // Or you can play 5 games (or more)
//! coup_game.looping(5);
//! ```
extern crate cfonts;

use cfonts::{render, Colors, Options};
Expand Down

0 comments on commit 0314fad

Please sign in to comment.