General idea: first display two interfaces: the user interface and the mine setting interface, then the user plays the game, and then judges whether the user steps on the mine, if there is a mine, the game is over; The total number, if the number of cleared mines is equal to the number of system mines, the user wins.
Header file reference:
main.c
game.c
Display the game interface:
Randomly define the number of mines:
If the user does not step on the mine, calculate the total number of mines around this location:
play games:
Output result graph: