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); }