From 1b354299d4d6c3c813d886145ce203f0f36d9dca Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 31 Jul 2024 09:34:18 +0200 Subject: [PATCH] fix(naive): don't hardcode pattern length --- src/solve/naive/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solve/naive/mod.rs b/src/solve/naive/mod.rs index f8cdee0..960bb3c 100644 --- a/src/solve/naive/mod.rs +++ b/src/solve/naive/mod.rs @@ -27,7 +27,7 @@ impl<'wl, WL: WordList> Solver<'wl, WL> for NaiveSolver<'wl, WL> { /// word, but don't know the position of. fn guess_for(&self, game: &crate::game::Game) -> WResult { // HACK: hardcoded length - let mut pattern: String = String::from("....."); + let mut pattern: String = ".".repeat(game.length()); let mut other_chars: Vec = Vec::new(); let response = game.last_response(); trace!(