Skip to content

Instantly share code, notes, and snippets.

@aarohmankad
Last active December 28, 2017 03:06
Show Gist options
  • Save aarohmankad/61133b916ee2155634ae6d805d11f9e8 to your computer and use it in GitHub Desktop.
Save aarohmankad/61133b916ee2155634ae6d805d11f9e8 to your computer and use it in GitHub Desktop.
vector<pair<int, int>> getThem() {
vector<pair<int, int>> v;
for (pair<int, int> x : theList) {
if (x.second == 4) {
v.push(x);
}
}
return v;
}
vector<pair<int, int>> findFlaggedCells() {
vector<pair<int, int>> flaggedCells;
const int FLAGGED = 4;
for (pair<int, int> cell : gameBoard) {
if (cell.second == FLAGGED) {
flaggedCells.push_back(cell);
}
}
return flaggedCells;
}
vector<Cell> findFlaggedCells() {
vector<Cell> flaggedCells;
const int FLAGGED = 4;
for (Cell cell : gameBoard) {
if (cell.status == FLAGGED) {
flaggedCells.push_back(cell);
}
}
return flaggedCells;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment