2024-03-26 00:16:26 +01:00
|
|
|
#![warn(clippy::all)]
|
|
|
|
// #![warn(missing_docs)]
|
|
|
|
#![warn(missing_debug_implementations)]
|
|
|
|
|
|
|
|
use clap::Parser;
|
|
|
|
use libpt::log::*;
|
|
|
|
|
2024-04-04 20:14:20 +02:00
|
|
|
use wordle_analyzer::solve::BuiltinSolverNames;
|
2024-03-26 00:16:26 +01:00
|
|
|
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
2024-04-04 20:14:20 +02:00
|
|
|
|
2024-03-26 00:16:26 +01:00
|
|
|
use wordle_analyzer::{self, game};
|
|
|
|
|
|
|
|
#[derive(Parser, Clone, Debug)]
|
|
|
|
#[command(version, about, long_about, author)]
|
|
|
|
struct Cli {
|
|
|
|
/// precompute all possibilities for better performance at runtime
|
|
|
|
#[arg(short, long)]
|
|
|
|
precompute: bool,
|
|
|
|
/// how long should the word be?
|
|
|
|
#[arg(short, long, default_value_t = wordle_analyzer::DEFAULT_WORD_LENGTH)]
|
|
|
|
length: usize,
|
|
|
|
/// how many times can we guess?
|
|
|
|
#[arg(short, long, default_value_t = wordle_analyzer::DEFAULT_MAX_STEPS)]
|
|
|
|
max_steps: usize,
|
|
|
|
/// more verbose logs
|
|
|
|
#[arg(short, long)]
|
|
|
|
verbose: bool,
|
|
|
|
/// which solver to use
|
|
|
|
#[arg(short, long, default_value_t = BuiltinSolverNames::default())]
|
|
|
|
solver: BuiltinSolverNames,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
|
|
let cli = Cli::parse();
|
|
|
|
if cli.verbose {
|
|
|
|
Logger::build_mini(Some(Level::TRACE))?;
|
|
|
|
} else {
|
|
|
|
Logger::build_mini(Some(Level::INFO))?;
|
|
|
|
}
|
|
|
|
debug!("dumping CLI: {:#?}", cli);
|
|
|
|
|
|
|
|
let wl = BuiltinWList::default();
|
2024-04-04 20:14:20 +02:00
|
|
|
let _builder = game::Game::builder(&wl)
|
2024-03-26 00:16:26 +01:00
|
|
|
.length(cli.length)
|
|
|
|
.max_steps(cli.max_steps)
|
|
|
|
.precompute(cli.precompute);
|
2024-04-04 20:14:20 +02:00
|
|
|
let _solver = cli.solver.to_solver(&wl);
|
|
|
|
let _bench = cli.solver.to_solver(&wl);
|
2024-03-26 00:16:26 +01:00
|
|
|
|
2024-03-31 16:33:56 +02:00
|
|
|
todo!();
|
2024-03-26 00:16:26 +01:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|