Checking consistency of guesses

This commit is contained in:
Matúš Púll 2024-11-07 10:39:48 +01:00
parent d5f5a02523
commit d68126bfbb

View file

@ -1,5 +1,6 @@
#pragma once
#include "gamestate.hpp"
#include "validate.hpp"
class Solver {
Game known;
@ -53,6 +54,12 @@ public:
positions_of_colors[guess[n]].push_back(n);
return positions_of_colors;
}
// Check, if it could have been this
bool is_consistent(vector<int> supposed_sequence, Historic_guess hist) {
auto response = validate(supposed_sequence, hist.guess);
return response[0] == hist.response[0] &&
response[1] == hist.response[1];
}
// Specific reactions
void if_not_here_then_nowhere(vector<int> guess) {