diff --git a/gamestate.hpp b/gamestate.hpp index 842075a..a413bb3 100644 --- a/gamestate.hpp +++ b/gamestate.hpp @@ -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> list_all_possibilities() { + auto r = vector>(N, vector(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