Checking consistency of guesses
This commit is contained in:
parent
d5f5a02523
commit
d68126bfbb
1 changed files with 7 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue