Crate heartless

source ·
Expand description

The heartless game library.

This is a game similar with mshearts but running in console.

See README.md for the rule of the game, the commandline interface and the input.

If the library users want to run this game in the background, and doing interaction with the player in another UI frontend, just enables the altio feature.

§Example

[dependencies]
heartless = { version = "0.1", features = ["altio"] }
#[cfg( feature="altio" )] {
    let config = heartless::cli::Config::from_args( std::env::args_os() );
    let mut game = heartless::Game::with_config( config );
    let game_io = game.altio.clone();
    std::thread::spawn( move || game.main_loop() );
    // use `game_io.send_line()`/`game_io.recv()` to communicate with `game`.
    // See https://docs.rs/altio for more.
}

Re-exports§

Modules§

  • Cards definition of storing, comparing, passing, discarding, printing.
  • Commandline interface and program configuration.
  • Implementation of game logic: input, output, rule checker, AI strategies.
  • Players related definitions.