Skip to content

Instantly share code, notes, and snippets.

@aarohmankad
Last active December 28, 2017 19:34
Show Gist options
  • Save aarohmankad/df3803b19d15c78df6333c49e0fb5df4 to your computer and use it in GitHub Desktop.
Save aarohmankad/df3803b19d15c78df6333c49e0fb5df4 to your computer and use it in GitHub Desktop.
An example of code abstraction
vector<Cell> findCells(const vector<Cell>& gameBoard, const int FLAG_CODE) {
vector<Cell> cells;
for (Cell cell : gameBoard) {
if (cell.status == FLAG_CODE) {
cells.push_back(cell);
}
}
return cells;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment