diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-09-11 00:20:38 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-09-11 09:19:15 +0200 |
| commit | f906c5d984c5f39f7b9d152bb57fba8459914e22 (patch) | |
| tree | eaa5803c52381d4a707395ff447365cd17109174 /labb1/src/life.cpp | |
| parent | bc5ec9a8a0027d6c6801fdc48a065a54a97856dc (diff) | |
| download | tddd86-f906c5d984c5f39f7b9d152bb57fba8459914e22.tar.gz | |
wip L2 and L1 const
Diffstat (limited to 'labb1/src/life.cpp')
| -rw-r--r-- | labb1/src/life.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/labb1/src/life.cpp b/labb1/src/life.cpp index cf5c6c9..1f582f6 100644 --- a/labb1/src/life.cpp +++ b/labb1/src/life.cpp @@ -11,7 +11,7 @@ * Print a representation of the grid. * Alive cells show as 'X', dead show as '-'. */ -void printGrid(Grid<bool> &grid) { +void printGrid(const Grid<bool> &grid) { for (int y = 0; y < grid.numRows(); y++) { for (int x = 0; x < grid.numCols(); x++) { if (grid.get(y, x)) { @@ -27,7 +27,7 @@ void printGrid(Grid<bool> &grid) { /* * Return 1 if (x, y) is in bounds and alive, otherwise 0. */ -int checkPoint(Grid<bool> &grid, int y, int x) { +int checkPoint(const Grid<bool> &grid, int y, int x) { return grid.inBounds(y, x) && grid.get(y, x) ? 1 : 0; } |
