3 releases (breaking)

Uses old Rust 2015

0.3.0 Jun 16, 2018
0.2.0 Jun 9, 2018
0.1.0 Jun 7, 2018

#848 in Games


Used in nzsc2p_json_interface

MIT license

22KB
511 lines

nzsc2p

Two-player NZSC.

Example

Taken from tests.rs:

extern crate nzsc2p;
use nzsc2p::two_player_game::{ NZSCTwoPlayerGame, WhichPlayer, Phase, };

let mut game = NZSCTwoPlayerGame::new();

game.process_choice(WhichPlayer::PlayerA, "Ninja".to_string()).unwrap();
game.process_choice(WhichPlayer::PlayerB, "Clown".to_string()).unwrap();

if let Phase::BoosterChoosing(ref a, ref b) = &g.phase {
    assert_eq!(a.points, 0);
    assert_eq!(b.points, 1);
} else {
    panic!();
}

Dependencies

~17KB