Having left something to learn from responses should be default
This commit is contained in:
parent
2f32921976
commit
f0fda2b9c9
1 changed files with 5 additions and 11 deletions
16
solver.hpp
16
solver.hpp
|
@ -51,7 +51,7 @@ public:
|
||||||
if(guess[n] > -1)
|
if(guess[n] > -1)
|
||||||
positions_of_colors[guess[n]].push_back(n);
|
positions_of_colors[guess[n]].push_back(n);
|
||||||
|
|
||||||
// If color can't be anywhere here, it can't be in the sequence
|
// If color isn't here, it can't be in the sequence
|
||||||
for(int col = 0; col < known.M; col++) {
|
for(int col = 0; col < known.M; col++) {
|
||||||
int possible_count = 0;
|
int possible_count = 0;
|
||||||
for(int n : positions_of_colors[col])
|
for(int n : positions_of_colors[col])
|
||||||
|
@ -73,7 +73,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool extract_info(Historic_guess hist) {
|
bool extract_info(Historic_guess hist) {
|
||||||
bool something_to_learn;
|
bool something_to_learn = true;
|
||||||
|
|
||||||
// A bit of cleaning
|
// A bit of cleaning
|
||||||
auto cleaned = clean(hist);
|
auto cleaned = clean(hist);
|
||||||
|
@ -87,21 +87,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// None at the right spot
|
// None at the right spot
|
||||||
else if(response[1] == 0) {
|
else if(response[1] == 0)
|
||||||
not_here(guess);
|
not_here(guess);
|
||||||
something_to_learn = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// At least only on the right spot
|
// At least only on the right spot
|
||||||
else if(response[0] == 0) {
|
else if(response[0] == 0)
|
||||||
if_not_here_then_nowhere(guess);
|
if_not_here_then_nowhere(guess);
|
||||||
something_to_learn = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nonzero / nonzero
|
// Nonzero / nonzero
|
||||||
else {
|
else {}
|
||||||
something_to_learn = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return something_to_learn;
|
return something_to_learn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue