Minesweeper game

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:



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324697992&siteId=291194637