finish bomb explode

master
thunic 2 years ago
parent 3b9e1ac22b
commit c722f18aa8

@ -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 getPositionIndices(int row, int col, Position* pos);
void getNewPosition(Position* pos, int dx, int dy, Position* newPos); void getNewPosition(Position* pos, int dx, int dy, Position* newPos);
void setFlag(int** hiddenGameBoard, int row, int col, int* numFlags); 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_ */ #endif /* INC_SPIELFELD_H_ */

@ -243,9 +243,9 @@ bool checkWin(int** gameBoard, int** hiddenGameBoard, int size, int numBombs, in
return uncoveredCells == totalCells - numBombs && numFlags == numBombs; 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);
} }

Loading…
Cancel
Save