由于源代码过长,这里只放测试用代码,可以自己写完和博主的对比一下看看谁写的好
绑定的资源按照资源描述操作就可以运行啦,想要源代码一键三连私聊我获取噢
#define _CRT_SECURE_NO_WARNINGS 1
#include<Minesweeper.h>
void menu()
{
printf("********************************************\n");
printf("**************** 1.play ********************\n");
printf("**************** 0.exit ********************\n");
printf("********************************************\n");
}
void game()
{
Initboard(mine,LENS,WIDS,'0');
Initboard(show, LENS, WIDS,'*');
Printboard(show, LEN, WID);
Putmine(mine,LEN,WID);
Printboard(mine, LEN, WID);
Sweepmine(mine,show, LEN, WID);
}
int main()
{
srand((unsigned int)time(NULL));
int input = 0;
do {
menu();
printf("请选择是否游戏>>");
scanf("%d", &input);
switch (input)
{
case 1:
game();
break;
case 0:
printf("退出游戏!");
break;
default:
printf("选择错误请重新选择!");
break;
}
} while (input);
return 0;
}