Having left something to learn from responses should be default

This commit is contained in:
Matúš Púll 2024-11-04 15:03:14 +01:00
parent 2f32921976
commit f0fda2b9c9

View file

@ -51,7 +51,7 @@ public:
if(guess[n] > -1)
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++) {
int possible_count = 0;
for(int n : positions_of_colors[col])
@ -73,7 +73,7 @@ public:
}
bool extract_info(Historic_guess hist) {
bool something_to_learn;
bool something_to_learn = true;
// A bit of cleaning
auto cleaned = clean(hist);
@ -87,21 +87,15 @@ public:
}
// None at the right spot
else if(response[1] == 0) {
else if(response[1] == 0)
not_here(guess);
something_to_learn = false;
}
// At least only on the right spot
else if(response[0] == 0) {
else if(response[0] == 0)
if_not_here_then_nowhere(guess);
something_to_learn = true;
}
// Nonzero / nonzero
else {
something_to_learn = true;
}
else {}
return something_to_learn;
}