#![doc = include_str!("../README.md")]
use clap::{Parser, Subcommand};
mod solver;
use solver::PruningMethod;
mod tt;
use tt::TTConf;
mod constdb;
use constdb::ConstDBConf;
mod cram;
mod chomp;
mod chomp_skyline;
mod grundy_game;
#[derive(Subcommand)]
pub enum GameConf {
Cram(cram::Conf),
Chomp(chomp::Conf),
ChompSL(chomp_skyline::Conf),
Grundy(grundy_game::Conf),
}
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
pub struct Conf {
#[command(subcommand)]
pub game: GameConf,
#[command(flatten)]
pub tt: TTConf,
#[command(flatten)]
pub cdb: ConstDBConf,
#[arg(short='m', long, value_enum)]
pub method: Option<PruningMethod>
}
fn main() {
let conf: Conf = Conf::parse();
match conf.game {
GameConf::Cram(cram_conf) => cram_conf.run(conf.method, conf.tt, conf.cdb),
GameConf::Chomp(chomp_conf) => chomp_conf.run(conf.method, conf.tt, conf.cdb),
GameConf::ChompSL(chomp_conf) => chomp_conf.run(conf.method, conf.tt, conf.cdb),
GameConf::Grundy(grundy_conf) => grundy_conf.run(conf.method, conf.tt, conf.cdb),
}
}