prisoner

Crates.ioprisoner
lib.rsprisoner
version0.6.3
sourcesrc
created_at2022-06-09 15:19:51.12309
updated_at2024-02-15 00:38:30.100465
descriptionA library for simulating "The Prisoner's Dilemna"
homepagehttps://github.com/iancullinane/prisoner-rust
repositoryhttps://github.com/iancullinane/prisoner-rust
max_upload_size
id602684
size31,952
Ian Cullinane (iancullinane)

documentation

README

example workflow Crate docs.rs

prisoner

A library for simulating "The Prisoner's Dilemna". Also comes with a main.rs to play with.

Provides enums for Choice and Outcome, these are all you really need to play the game. The public function determine will give you a result. The Outcome enum also provides methods for calculating a score. It supports the classic reward mechanism (0, -1, -2, -3) reward based scoring system, and an algebraic return (ie T > R > P > S). Currently does not implement Ord.

Usage

main.rs shows how to use clap generate a CLI. This is also the entry point for the docker container.

prisoner 0.5.0
Ian Cullinane <ian@iancullinane.com>
A library for simulating "The Prisoner's Dilemna"

USAGE:
    prisoner [OPTIONS] --players <PLAYERS>

OPTIONS:
    -h, --help                 Print help information
    -p, --players <PLAYERS>    
    -r, --rounds <ROUNDS>      
    -V, --version              Print version information
Commit count: 40

cargo fmt