From 8847e109019baf9ad18bd9a5723d1ccbefd918d9 Mon Sep 17 00:00:00 2001 From: h3-alsaddi <hamed2.alsaddi@live.uwe.ac.uk> Date: Wed, 12 Mar 2025 05:21:05 +0000 Subject: [PATCH] Some new changes --- game.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/game.hpp b/game.hpp index 7edf9dc..942c8f2 100644 --- a/game.hpp +++ b/game.hpp @@ -7,7 +7,32 @@ public: void start(); private: + static const int SIZE = 4; + int board[SIZE][SIZE]; + int score; + + // Initialization void initBoard(); + void addRandomTile(); + + // Movement + void moveLeft(); + void moveRight(); + void moveUp(); + void moveDown(); + + // Helper functions + void transpose(); + void reverseRow(int rowIndex); + void compressRow(int row[4]); + void mergeRow(int row[4]); + + // Logic + bool checkGameOver(); + bool hasEmptyCell(); + bool canMerge(); + + // UI void printBoard(); }; -- GitLab