automatic cargo CI changes

This commit is contained in:
cscherrNT 2024-03-22 13:13:33 +00:00 committed by github-actions[bot]
parent 1336fdba10
commit 24d3ef05b7
5 changed files with 12 additions and 11 deletions

View File

@ -1,14 +1,12 @@
#![warn(clippy::all)]
// #![warn(missing_docs)]
#![warn(missing_debug_implementations)]
use std::io::Write;
use clap::Parser;
use libpt::log::*;
use wordle_analyzer::error::GameError;
use wordle_analyzer::game::response::GuessResponse;
use wordle_analyzer::game::Game;
use wordle_analyzer::solve::{stupid, BuiltinSolvers, Solver};
use wordle_analyzer::wlist::builtin::BuiltinWList;
use wordle_analyzer::wlist::word::Word;
@ -49,17 +47,15 @@ fn main() -> anyhow::Result<()> {
.max_steps(cli.max_steps)
.precompute(cli.precompute);
let solver = match cli.solver {
BuiltinSolvers::Naive => {
stupid::StupidSolver::build(&wl)?
},
_ => todo!()
BuiltinSolvers::Naive => stupid::StupidSolver::build(&wl)?,
_ => todo!(),
};
let mut game = builder.build()?;
debug!("{game:#?}");
let mut response: GuessResponse;
let mut guess: Word;
let mut _guess: Word;
loop {
response = solver.play(&mut game)?;
println!("{response}");

View File

@ -17,7 +17,7 @@ pub enum Error {
},
// for `FromStr` of `BuiltinSolver`
#[error("Unknown builtin solver")]
UnknownBuiltinSolver
UnknownBuiltinSolver,
}
#[derive(Debug, Clone, Error)]

View File

@ -178,7 +178,7 @@ impl<'wl, WL: WordList> GameBuilder<'wl, WL> {
length: super::DEFAULT_WORD_LENGTH,
precompute: false,
max_steps: super::DEFAULT_MAX_STEPS,
wordlist: wl
wordlist: wl,
}
}

View File

@ -25,7 +25,11 @@ pub enum Status {
}
impl GuessResponse {
pub(crate) fn new<WL: WordList>(guess: Word, status: Vec<(char, Status)>, game: &Game<WL>) -> Self {
pub(crate) fn new<WL: WordList>(
guess: Word,
status: Vec<(char, Status)>,
game: &Game<WL>,
) -> Self {
let finish: bool = if game.step() > game.max_steps() {
true
} else {

View File

@ -0,0 +1 @@