Merge branch 'master' of https://git.cscherr.de/PlexSheep/wordle-analyzer
cargo devel CI / cargo CI (push) Successful in 47s Details

This commit is contained in:
Christoph J. Scherr 2024-03-21 16:29:07 +01:00
commit a3e348ba91
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
2 changed files with 6 additions and 4 deletions

View File

@ -83,13 +83,14 @@ pub struct GameBuilder<WL: WordList> {
length: usize,
precompute: bool,
max_steps: usize,
wordlist: WL
wordlist: WL,
}
impl<WL: WordList> GameBuilder<WL> {
/// build a [`Game`] with the stored configuration
pub fn build(self) -> anyhow::Result<Game<WL>> {
let game: Game<WL> = Game::build(self.length, self.precompute, self.max_steps, WL::default())?;
let game: Game<WL> =
Game::build(self.length, self.precompute, self.max_steps, WL::default())?;
Ok(game)
}
@ -125,7 +126,7 @@ impl<WL: WordList> Default for GameBuilder<WL> {
length: super::DEFAULT_WORD_LENGTH,
precompute: false,
max_steps: super::DEFAULT_MAX_STEPS,
wordlist: WL::default()
wordlist: WL::default(),
}
}
}

View File

@ -1,4 +1,5 @@
use rand::{prelude::*, seq::IteratorRandom};
use rand::{seq::IteratorRandom};
use std::collections::HashMap;
use std::ops::RangeBounds;