Skip to content

Instantly share code, notes, and snippets.

@Kilenaitor
Forked from aarohmankad/bad_names.cpp
Last active December 9, 2017 21:37
Show Gist options
  • Save Kilenaitor/363ddfe5857b9c0b103a30439275a5a5 to your computer and use it in GitHub Desktop.
Save Kilenaitor/363ddfe5857b9c0b103a30439275a5a5 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;
}
typdef std::pair<int, int> Cell;
const int FLAGGED_VALUE = 4;
vector<Cell> findFlaggedCells() {
vector<Cell> flaggedCells;
for(Cell cell : gameBoard) {
if (cell.second == FLAGGED_VALUE) {
flaggedCells.push_back(cell);
}
}
return flaggedCells;
}
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment