generated from PlexSheep/rs-base
Compare commits
1 commit
aac3e8804e
...
714aac0d86
Author | SHA1 | Date | |
---|---|---|---|
714aac0d86 |
1 changed files with 5 additions and 2 deletions
|
@ -39,6 +39,10 @@ impl<'wl, WL: WordList> Solver<'wl, WL> for NaiveSolver<'wl, WL> {
|
|||
match p.1 {
|
||||
Status::Matched => {
|
||||
pattern.replace_range(idx..idx + 1, &p.0.to_string());
|
||||
|
||||
other_chars.entry(p.0).or_default();
|
||||
let v = other_chars.get_mut(&p.0).unwrap();
|
||||
v.1 += 1;
|
||||
}
|
||||
Status::Exists => {
|
||||
other_chars.entry(p.0).or_default();
|
||||
|
@ -46,8 +50,7 @@ impl<'wl, WL: WordList> Solver<'wl, WL> for NaiveSolver<'wl, WL> {
|
|||
v.0.push(idx);
|
||||
|
||||
// TODO: count how many times the char occurs
|
||||
v.1 =
|
||||
v.1.min(evaluation.guess().chars().filter(|c| *c == p.0).count());
|
||||
v.1 += 1;
|
||||
}
|
||||
Status::None => {
|
||||
other_chars.entry(p.0).or_default();
|
||||
|
|
Loading…
Add table
Reference in a new issue