generated from PlexSheep/rs-base
moar attributes
cargo devel CI / cargo CI (push) Successful in 40s
Details
cargo devel CI / cargo CI (push) Successful in 40s
Details
This commit is contained in:
parent
6c267b66a5
commit
76453dedf6
|
@ -1,6 +1,9 @@
|
|||
#![warn(clippy::all)]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(missing_debug_implementations)]
|
||||
use clap::Parser;
|
||||
use libpt::log::*;
|
||||
use wordle_analyzer::{game,self};
|
||||
use wordle_analyzer::{self, game};
|
||||
|
||||
#[derive(Parser, Clone, Debug)]
|
||||
#[command(version, about, long_about, author)]
|
||||
|
@ -13,7 +16,7 @@ struct Cli {
|
|||
length: usize,
|
||||
/// how many times can we guess?
|
||||
#[arg(short, long, default_value_t = wordle_analyzer::DEFAULT_MAX_STEPS)]
|
||||
max_steps: usize
|
||||
max_steps: usize,
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
|
@ -23,7 +26,8 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
let game = game::Game::builder()
|
||||
.length(cli.length)
|
||||
.precompute(cli.precompute).build()?;
|
||||
.precompute(cli.precompute)
|
||||
.build()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -31,8 +35,10 @@ fn main() -> anyhow::Result<()> {
|
|||
fn get_word(cli: &Cli) -> String {
|
||||
let mut word = String::new();
|
||||
|
||||
todo!("get user input");
|
||||
todo!("validate user input");
|
||||
// TODO: get user input
|
||||
// TODO: validate user input
|
||||
|
||||
todo!();
|
||||
|
||||
assert_eq!(word.len(), cli.length);
|
||||
word
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#![warn(clippy::all)]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(missing_debug_implementations)]
|
||||
fn main() {
|
||||
unimplemented!();
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct Game {
|
||||
length: usize,
|
||||
precompute: bool,
|
||||
|
@ -42,14 +43,7 @@ impl Game {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Game {
|
||||
fn default() -> Self {
|
||||
GameBuilder::default()
|
||||
.build()
|
||||
.expect("could not build game with defaults")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct GameBuilder {
|
||||
length: usize,
|
||||
precompute: bool,
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#![warn(clippy::all)]
|
||||
#![warn(missing_docs)]
|
||||
#![warn(missing_debug_implementations)]
|
||||
|
||||
/// Default letters of a solution word
|
||||
pub const DEFAULT_WORD_LENGTH: usize = 5;
|
||||
/// Default amount of guesses per game
|
||||
pub const DEFAULT_MAX_STEPS: usize = 6;
|
||||
|
||||
pub mod game;
|
||||
|
|
Loading…
Reference in New Issue