Skip to content

Commit

Permalink
added grid::getTile
Browse files Browse the repository at this point in the history
  • Loading branch information
AnasImloul committed Oct 31, 2023
1 parent a8f21e3 commit b1ec64f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class grid {

bool move(int direction);

inline int32_t getScore() const { return score; }
inline int8_t getTile(int i, int j) { return tiles[i][j]; }

inline int64_t getScore() const { return score; }
inline int16_t getEmpty() const { return empty; }
inline bool isBlocked() const { return blocked; }

private:

bool add();

int8_t tiles[SIZE][SIZE]; // tiles on the grid (0 = empty, 2^x = tile with value x)
int32_t score; // current score
int64_t score; // current score
int16_t empty; // number of empty tiles
bool blocked; // if the grid is blocked, the game is over

};

0 comments on commit b1ec64f

Please sign in to comment.