From c722f18aa88c1ed24dbffea1c78bd4e469ce00d3 Mon Sep 17 00:00:00 2001 From: thunic Date: Sun, 17 Mar 2024 11:52:46 +0100 Subject: [PATCH] finish bomb explode --- Minesweeper/Core/Inc/spielfeld.h | 2 ++ Minesweeper/Core/Src/spielfeld.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Minesweeper/Core/Inc/spielfeld.h b/Minesweeper/Core/Inc/spielfeld.h index c786eac..d89fdcd 100644 --- a/Minesweeper/Core/Inc/spielfeld.h +++ b/Minesweeper/Core/Inc/spielfeld.h @@ -39,5 +39,7 @@ void revealCell(int** gameBoard, int** hiddenGameBoard, int size, int row, int c void getPositionIndices(int row, int col, Position* pos); void getNewPosition(Position* pos, int dx, int dy, Position* newPos); void setFlag(int** hiddenGameBoard, int row, int col, int* numFlags); +bool checkWin(int** gameBoard, int** hiddenGameBoard, int size, int numBombs, int numFlags); +void handleBombExploded(); #endif /* INC_SPIELFELD_H_ */ diff --git a/Minesweeper/Core/Src/spielfeld.c b/Minesweeper/Core/Src/spielfeld.c index 89b9183..a8f78b5 100644 --- a/Minesweeper/Core/Src/spielfeld.c +++ b/Minesweeper/Core/Src/spielfeld.c @@ -243,9 +243,9 @@ bool checkWin(int** gameBoard, int** hiddenGameBoard, int size, int numBombs, in return uncoveredCells == totalCells - numBombs && numFlags == numBombs; } -void handleBombExploded() -{ - +void handleBombExploded() { + char message[] = "Game Over! You hit a bomb.\r\n"; + HAL_UART_Transmit(&huart2, (uint8_t*)message, sizeof(message), 100); }