improve naive solver #13

Open
cscherrNT wants to merge 13 commits from feat/naive into devel
1 changed files with 0 additions and 20 deletions
Showing only changes of commit a9549aedc0 - Show all commits

View File

@ -131,14 +131,6 @@ impl<'wl, WL: WordList> Game<'wl, WL> {
let mut status: Status; let mut status: Status;
let mut buf: Vec<char> = solution.chars().collect(); let mut buf: Vec<char> = solution.chars().collect();
#[cfg(debug_assertions)]
let buflen = solution.len();
#[cfg(debug_assertions)]
{
assert_eq!(buflen, buf.len());
assert_eq!(buflen, evaluation.len());
}
// first the correct solutions // first the correct solutions
for ((idx, c_guess), c_sol) in guess.chars().enumerate().zip(solution.chars()) { for ((idx, c_guess), c_sol) in guess.chars().enumerate().zip(solution.chars()) {
if c_guess == c_sol { if c_guess == c_sol {
@ -148,12 +140,6 @@ impl<'wl, WL: WordList> Game<'wl, WL> {
} }
} }
#[cfg(debug_assertions)]
{
assert_eq!(buflen, buf.len());
assert_eq!(buflen, evaluation.len());
}
// then check if the char exists, but was not guessed to be at the correct position // then check if the char exists, but was not guessed to be at the correct position
// //
// We split this up, because finding the "exists" chars at the same time as the "correct" // We split this up, because finding the "exists" chars at the same time as the "correct"
@ -175,12 +161,6 @@ impl<'wl, WL: WordList> Game<'wl, WL> {
} }
evaluation[idx] = (c_guess, status); evaluation[idx] = (c_guess, status);
} }
#[cfg(debug_assertions)]
{
assert_eq!(buflen, buf.len());
assert_eq!(buflen, evaluation.len());
}
evaluation.into() evaluation.into()
} }