该游戏为控制台游戏,不基于easyx,100%可运行。写作不易,留个赞吧!
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
char choice;
int mine[105][105];
int sign[105][105];
int longg,wide,minenum=0;
void input() {
system("cls");
cout<<"扫雷游戏\n";
cout<<"选择难度\n";
cout<<"A. 9*9的格子,有10个地雷\n";
cout<<"B. 16*16的格子,有40个地雷\n";
cout<<"C. 16*30的格子,有99个地雷\n";
cout<<"输入选择(A或B或C):";
cin>>choice;
system("cls");
cout<<"你的选择是"<<choice;
if(choice=='A') cout<<"("<<"9*9的格子,有10个地雷)";
else if(choice=='B') cout<<"("<<"16*16的格子,有40个地雷)";
else cout<<"("<<"16*30的格子,有99个地雷)";
cout<<endl;
cout<<"你确定这个难度吗?输入Y或N:";
char confirm;
cin>>confirm;
if(confirm=='Y') return;
else {
input();
return;
}
}
void init() {
longg=wide=9;
minenum=10;
if(choice=='B')
longg=wide=16,minenum=40;
else if(choice=='C') longg=