From 90962f793887fd147dfc247e7f5b0d66ab9dac83 Mon Sep 17 00:00:00 2001 From: dawidg81 Date: Mon, 2 Feb 2026 12:30:03 +0100 Subject: Added game input and board clear --- src/Game.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/Game.cpp') diff --git a/src/Game.cpp b/src/Game.cpp index 7e54371..3e7384b 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -103,6 +103,12 @@ int Game::editDiff(){ */ void Game::displayBoard() { + #ifdef _WIN32 + system("cls"); + #else + system("clear"); + #endif + for (int i = 0; i < boardHeight; i++) { for (int j = 0; j < boardWidth; j++) { if (tileMap[i][j] == 0) { @@ -130,3 +136,16 @@ void Game::displayBoard() { putchar('\n'); } } + +void Game::input(){ + std::string input; + + std::cout << "game>"; + std::cin >> input; + + if(input == "q"){ + inGame = false; + } else { + std::cout << "Unknown command '" << input << "'.\n"; + } +} -- cgit v1.2.3