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 clap::Parser;
|
||||||
use libpt::log::*;
|
use libpt::log::*;
|
||||||
use wordle_analyzer::{game,self};
|
use wordle_analyzer::{self, game};
|
||||||
|
|
||||||
#[derive(Parser, Clone, Debug)]
|
#[derive(Parser, Clone, Debug)]
|
||||||
#[command(version, about, long_about, author)]
|
#[command(version, about, long_about, author)]
|
||||||
|
@ -13,7 +16,7 @@ struct Cli {
|
||||||
length: usize,
|
length: usize,
|
||||||
/// how many times can we guess?
|
/// how many times can we guess?
|
||||||
#[arg(short, long, default_value_t = wordle_analyzer::DEFAULT_MAX_STEPS)]
|
#[arg(short, long, default_value_t = wordle_analyzer::DEFAULT_MAX_STEPS)]
|
||||||
max_steps: usize
|
max_steps: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
|
@ -23,7 +26,8 @@ fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
let game = game::Game::builder()
|
let game = game::Game::builder()
|
||||||
.length(cli.length)
|
.length(cli.length)
|
||||||
.precompute(cli.precompute).build()?;
|
.precompute(cli.precompute)
|
||||||
|
.build()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -31,8 +35,10 @@ fn main() -> anyhow::Result<()> {
|
||||||
fn get_word(cli: &Cli) -> String {
|
fn get_word(cli: &Cli) -> String {
|
||||||
let mut word = String::new();
|
let mut word = String::new();
|
||||||
|
|
||||||
todo!("get user input");
|
// TODO: get user input
|
||||||
todo!("validate user input");
|
// TODO: validate user input
|
||||||
|
|
||||||
|
todo!();
|
||||||
|
|
||||||
assert_eq!(word.len(), cli.length);
|
assert_eq!(word.len(), cli.length);
|
||||||
word
|
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 {
|
pub struct Game {
|
||||||
length: usize,
|
length: usize,
|
||||||
precompute: bool,
|
precompute: bool,
|
||||||
|
@ -42,14 +43,7 @@ impl Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Game {
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
fn default() -> Self {
|
|
||||||
GameBuilder::default()
|
|
||||||
.build()
|
|
||||||
.expect("could not build game with defaults")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct GameBuilder {
|
pub struct GameBuilder {
|
||||||
length: usize,
|
length: usize,
|
||||||
precompute: bool,
|
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;
|
pub const DEFAULT_WORD_LENGTH: usize = 5;
|
||||||
|
/// Default amount of guesses per game
|
||||||
pub const DEFAULT_MAX_STEPS: usize = 6;
|
pub const DEFAULT_MAX_STEPS: usize = 6;
|
||||||
|
|
||||||
pub mod game;
|
pub mod game;
|
||||||
|
|
Loading…
Reference in New Issue