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