方法适合于任何台式机笔记本
Apex机器码-逃离塔科夫机器码均可彻底解决!
用心仔细看下方即可!
Kslcckxpkc-可观看教程
void menu()
{
printf("********************\n");
printf("****** 1.play ******\n");
printf("****** 0.exit ******\n");
printf("********************\n");
}
void SetMine(char mine[ROWS][COLS], int row, int col)
{
int count = EASY_COUNT;
while (count)
{
int x = rand() % row + 1;
int y = rand() % col + 1;
if (mine[x][y] =='0')
{
mine[x][y] = '1';
count--; static int get_mine_count(char mine[ROWS][COLS], int x, int y)
InitBoard(mine, ROWS, COLS, '0');
InitBoard(show, ROWS, COLS, '*');//
DisplayBoard(mine, ROW, COL);
DisplayBoard(show, ROW, COL);
nt main()
{
int input = 0;
do
{
menu();
printf(":>");
scanf("%d", &input);
switch (input)
{
case 1:
game();//实现游戏的函数
break;
case 0:
printf("\n");
break;
default:
printf("n");
break;
}
} while (input);
return 0;
void InitBoard(char board[ROWS][COLS], int rows, int cols, char set)
{
int i = 0;
int j = 0;
for (i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++)
{
board[i][j] = set;
}
}
#define ROW 9
#define COL 9
}
void DisplayBoard(char board[ROWS][COLS], int row, int col)
{
int i = 0;
int j = 0;
{
return mine[x - 1][y - 1] +
mine[x - 1][y] +
mine[x - 1][y + 1] +
mine[x][y - 1] +
mine[x][y + 1] +
mine[x + 1][y - 1] +
mine[x + 1][y] +
mine[x + 1][y + 1] - 8 * '0';
if (win == row * col - EASY_COUNT)
{
printf("KCX,ckx!\n");
DisplayBoard(mine, ROW, COL);