~ryguy/ncpig

Algorithms for (multiplayer) non-cooperative perfect information games, written in rust ⚡️.
chore: release 0.5.0
feat(mcts): get graph from one playout
fix: reexport search traits in prelude

clone

read-only
https://git.sr.ht/~ryguy/ncpig
read/write
git@git.sr.ht:~ryguy/ncpig

You can also use your local clone with git send-email.

#ncpig 🐷

Algorithms for (multiplayer) non-cooperative perfect information games, written in rust ⚡️.

The core crate is in ncpig. Numerous example games used for testing can be found in ncpig-testing.

#Example

use ncpig::prelude::*;
use ncpig_testing::rolit::*;
fn main() -> anyhow::Result<()> {
    let game = Rolit::new([RolitPlayer::Green, RolitPlayer::Blue]);
    let state = RolitState::default();
    let bot = Random::new();
    let competition = Competition::new(&game, [&bot, &bot], true);
    let finalstate = competition.play(state)?;
    for player in game.players() {
        println!("{player}: {}", game.score(player, &finalstate)?);
    }
    Ok(())
}

#Developers

See the wiki for more info that could be useful to developers.