1 use clap::{Parser, Subcommand, ValueEnum};
2 use pluta_lesnura::{coordinating_player, momentum_player, play, random_player, Game};
5 #[command(author, version, about, long_about = None, arg_required_else_help = true)]
8 command: Option<Commands>,
11 #[derive(Clone, Debug, ValueEnum)]
22 /// For momentum play, draw how often? 0-1
23 #[arg(short = 'p', long, default_value_t = 0.5)]
26 #[arg(short = 'g', long, default_value_t = 1)]
29 #[arg(short = 'p', long)]
31 /// What strategy should players use?
32 #[arg(short = 's', long, value_enum)]
37 fn main() -> Result<(), &'static str> {
38 let cli = Cli::parse();
47 let player = || match strategy {
48 Strategy::Random => random_player(*draw_chance),
49 Strategy::Momentum => momentum_player(random_player(*draw_chance)),
50 Strategy::Coordinate => {
51 momentum_player(coordinating_player(random_player(*draw_chance)))
54 for _ in 0..*num_games {
55 let players: Vec<_> = std::iter::from_fn(|| Some(player()))
58 let mut game = Game::default();
59 for _ in 0..*num_players {
62 let result = play(game, players)?;
63 println!("Result: {result:?}");
67 None => unreachable!(),