Get all possible colors for all positions

This commit is contained in:
Matúš Púll 2024-11-05 11:53:24 +01:00
parent 7889133977
commit d5f5a02523

View file

@ -45,7 +45,7 @@ public:
return -1;
}
// Print known information
// Get known information
void print() {
cout << " ";
for(int col = 0; col < M; col++)
@ -58,6 +58,15 @@ public:
cout << std::endl;;
}
}
// Get all possible colors for all positions
vector<vector<int>> list_all_possibilities() {
auto r = vector<vector<int>>(N, vector<int>(0));
for(int col = 0; col < M; col++)
for(int n = 0; n < N; n++)
if(possible[n][col])
r[col].push_back(n);
return r;
}
};
// For remembering guesses with their responses