0
已解决
王文博
缔造者之神
缔造者之神
注释版出来了!
新增了一些地图,增加了注释。
代码如下:
#include <bits/stdc++.h>//万能头文件
#include <conio.h>//函数_getch()所需头文件
#include <windows.h>
#include <iomanip>//输入输出流控制符setw()所在头文件,设置字段宽度为n位
using namespace std;
#define R 26//行 26 关于行的数量仍然有争议
#define C 26//列 26 关于列的数量仍然有争议
BOOL flag = true; //定义布尔值的标记,方便在游戏时直接退出
int pass=1;//初始关卡值
char d='0';//选择作者创作的地图的关卡难度
char e;//选择玩同学创作还是玩作者创作的
char f='0';//选择玩谁的地图
int g=-1;//选择模式
int z1=1,z2=1;//用于导弹模式中判断
void choose();//这些都是函数声明,就算子函数在主函数前面也最好要有,防止不必要的错误
void clear();
void color(int m);
int DrawMap();
int finish();
void Move();
void setmap(int n,char a,char b);
void Description();
//特别感谢:黄中阳 刘宇航 沙宸安 熊智晖(按音序排列)
//作者创作的地图分难度,同学创作的地图不分难度,并且同学创作中只选2位创作最多的分人(如沙宸安创作的为TS,刘宇航创作的为TL,其余同学创作的为TY)
//下面没有D的地图为1个人的地图,有D的地图为2个人的地图
int WJmap[R][C] = { 0 };//简单地图
int WJmap1[R][C] =
{//地图1
{ 0,0,1,1,1,0,0,0 },
{ 0,0,1,3,1,0,0,0 },
{ 0,0,1,0,1,1,1,1 },
{ 1,1,1,0,0,4,3,1 },
{ 1,3,4,4,0,1,1,1 },
{ 1,1,1,5,4,1,0,0 },
{ 0,0,0,1,3,1,0,0 },
{ 0,0,0,1,1,1,0,0 },
};
int WJmap2[R][C]=
{//地图2
{1,1,1,1,1,0,0,0,0,0},
{1,5,0,0,1,0,0,0,0,0},
{1,0,4,4,1,0,1,1,1,0},
{1,0,4,0,1,0,1,3,1,0},
{1,1,1,0,1,1,1,3,1,0},
{1,1,1,0,0,0,0,3,1,0},
{1,0,0,0,0,0,0,0,1,0},
{1,0,0,0,0,1,1,1,1,0},
{1,0,0,0,0,1,0,0,0,0},
{1,1,1,1,1,1,0,0,0,0},
};
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,0,0,4,0,0,1,0,0,1,0,1,1,1 },
{ 1,1,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,1,1,1,1 },
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
};
int DWJmap[R][C] = { 0 };//简单地图
int DWJmap1[R][C] =
{//地图1
{ 0,0,1,1,1,0,0,0 },
{ 0,0,1,3,1,0,0,0 },
{ 0,0,1,0,1,1,1,1 },
{ 1,1,1,0,6,4,3,1 },
{ 1,3,4,4,0,1,1,1 },
{ 1,1,1,5,4,1,0,0 },
{ 0,0,0,1,3,1,0,0 },
{ 0,0,0,1,1,1,0,0 },
};
int DWJmap2[R][C]=
{//地图2
{1,1,1,1,1,0,0,0,0,0},
{1,5,0,0,1,0,0,0,0,0},
{1,0,4,4,1,0,1,1,1,0},
{1,0,4,0,1,0,1,3,1,0},
{1,1,1,0,1,1,1,3,1,0},
{1,1,1,0,0,0,0,3,1,0},
{1,0,0,0,0,0,0,0,1,0},
{1,0,0,0,0,1,1,1,1,0},
{1,0,0,0,6,1,0,0,0,0},
{1,1,1,1,1,1,0,0,0,0},
};
int DWJmap3[R][C]=
{//地图3
{ 1,1,1,1,1,1,1,1,1,1,1,1 },
{ 1,0,0,0,0,0,1,0,0,0,3,1 },
{ 1,4,0,0,0,0,1,0,0,0,0,1 },
{ 1,0,1,1,1,0,1,0,0,0,0,1 },
{ 1,0,0,5,1,0,1,0,0,0,0,1 },
{ 1,0,1,1,1,0,1,0,0,4,0,1 },
{ 1,0,0,0,0,0,1,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,4,0,0,1,0,0,0,0,1 },
{ 1,3,0,0,0,0,1,0,0,0,0,1 },
{ 1,0,0,0,6,0,1,0,0,0,3,1 },
{ 1,1,1,1,1,1,1,1,1,1,1,1 },
};
/*二维数组地图
1.表示墙体
3.表示目的地
4.表示箱子
5.表示人
0.表示空地
*/
int DWJmap4[R][C]=
{//地图4
{ 1,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,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1 },
{ 1,0,1,3,0,0,0,0,3,0,0,0,4,0,1,1,0,0,1,0,1 },
{ 1,0,1,0,0,0,4,0,1,0,0,0,0,4,1,1,1,1,1,0,1 },
{ 1,0,0,0,4,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1 },
{ 1,0,4,0,0,0,1,1,0,0,3,0,0,0,0,0,3,0,0,0,1 },
{ 1,0,0,0,0,0,1,3,0,4,0,0,0,1,0,0,1,0,0,1,1 },
{ 1,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1 },
{ 1,0,0,0,1,0,0,0,3,0,0,0,0,0,1,0,0,4,0,0,1 },
{ 1,0,1,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1 },
{ 1,0,1,3,1,0,1,3,0,0,1,0,0,0,0,1,1,1,1,0,1 },
{ 1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1,1 },
{ 1,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,3,0,0,1,1 },
{ 1,1,0,0,0,0,0,0,0,0,4,0,0,1,0,0,1,0,1,1,1 },
{ 1,1,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,1,1,1,1 },
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
};
void clear()//清屏函数,对于推箱子的意义重大,但是也存在问题
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coordScreen = { 0, 0 };
SetConsoleCursorPosition( hConsole, coordScreen );
}
void Game_Menu()//游戏初始界面
{
system("cls");
cout<<"***********************************\n\n\n";
cout<<" 双人推箱子小游戏 \n";
cout<<" 请按两次S或s键进入游戏 \n\n\n";
cout<<"***********************************\n";
_getch();//不用按Enter键完成输入
}
void Description()//游戏描述仍然需要修改
{
system("cls");
cout<<"游戏规则:把所有箱子推到目的地上即为胜利。\n";
cout<<"此游戏可以有两个人一起玩。\n";
cout<<"1号小人:\n上:W或w\n下:S或s\n左:A或a\n右:D或d";
cout<<"\n2号小人:\n上:↑\n下:↓\n左:←\n右:→\n";
system("pause");
system("cls");
}
void color(int m) //颜色函数,用来改变箱子,目的地,人的颜色(绿色也可以)
{
HANDLE consolehend;
consolehend = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(consolehend, m);
return ;
}
int DrawMap()//绘制地图
{
cout<<"关卡:"<<pass<<endl;//输出关卡数
if(g==1)//按照g的大小判断到底是哪个模式
{
if(e=='W')//作者创作的地图
{
if(d=='J')//简单地图
{
for (int i = 0; i < R; i++)//双重循环遍历,次数为R*C,所以控制R和C的大小至关重要
{
for (int j = 0; j < C; j++)
{
switch (WJmap[i][j])//switch语句,更适合来判断多种情况,作用相当于多个else if
{
case 0://0是空地,输出空格即可,颜色必须为无色
color(0xF);
cout << " ";
break;
case 1://1是墙
color(8);
cout << "■";
break;
case 3://3是目的地
color(0xE);
cout << "☆";
break;
case 4://4是箱子
color(4);
cout << "□";
break;
case 5://5是1号小人
color(3);
cout << "①";
break;
case 6://6是2号小人
color(3);
cout<<"②";
break;
case 7://7是3+4
color(6);
cout << "★";
break;
case 8://8是3+5
color(3);
cout << "①";
break;
case 9://9是3+6
color(3);
cout<<"②";
break;
case 11://11是5+6
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')//平均地图,后面的都懂,不再标注
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==2)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==3)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==6)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (WKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (TYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==4)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==5)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==7)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
else if(g==8)
{
if(e=='W')
{
if(d=='J')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWJmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='P')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWPmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(d=='K')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DWKmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTLmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='S')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTSmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout <<endl;
}
}
if(f=='Y')
{
for (int i = 0; i < R; i++)
{
for (int j = 0; j < C; j++)
{
switch (DTYmap[i][j])
{
case 0:
color(0xF);
cout << " ";
break;
case 1:
color(8);
cout << "■";
break;
case 3:
color(0xE);
cout << "☆";
break;
case 4:
color(4);
cout << "□";
break;
case 5:
color(3);
cout << "①";
break;
case 6:
color(3);
cout<<"②";
break;
case 7:
color(6);
cout << "★";
break;
case 8:
color(3);
cout << "①";
break;
case 9:
color(3);
cout<<"②";
break;
case 11:
color(3);
cout<<"②";
break;
default:
break;
}
}
cout<<endl;
}
}
}
}
return 0;
}
void Move()//Move函数,来判断小人的行走以及各种判断,改变
{
if(g==1)//之前提到过
{
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;//r和c为1号小人的位置,l和m为2号小人的位置
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WJmap[i][j]==5||WJmap[i][j]==8||WJmap[i][j]==11)//遍历整个地图,找到2个小人的位置。
{
r=i;
c=j;
}
if(WJmap[i][j]==6||WJmap[i][j]==9||WJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();//不用按Enter输入
switch(ch)
{
case 'W'://如果按W该怎么办
case 'w':
if(WJmap[r-1][c]==0||WJmap[r-1][c]==3||WJmap[r-1][c]==6)//如果上面是空地或目的地或2号小人,就能移动
{
WJmap[r-1][c]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r-1][c]==4||WJmap[r-1][c]==7||WJmap[r-1][c]==6)//如果是箱子,目的地+箱子,2号小人
{
if(WJmap[r-2][c]==0||WJmap[r-2][c]==3)//还要上面是空地或者目的地,不然就会出现箱子推墙里的情况
{
WJmap[r-2][c]+=4;
WJmap[r-1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WJmap[r+1][c]==0||WJmap[r+1][c]==3||WJmap[r+1][c]==6)
{
WJmap[r+1][c]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r+1][c]==4||WJmap[r+1][c]==7||WJmap[r+1][c]==6)
{
if(WJmap[r+2][c]==0||WJmap[r+2][c]==3)
{
WJmap[r+2][c]+=4;
WJmap[r+1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WJmap[r][c-1]==0||WJmap[r][c-1]==3||WJmap[r][c-1]==6)
{
WJmap[r][c-1]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r][c-1]==4||WJmap[r][c-1]==7||WJmap[r][c-1]==6)
{
if(WJmap[r][c-2]==0||WJmap[r][c-2]==3)
{
WJmap[r][c-2]+=4;
WJmap[r][c-1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WJmap[r][c+1]==0||WJmap[r][c+1]==3||WJmap[r][c+1]==6)
{
WJmap[r][c+1]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r][c+1]==4||WJmap[r][c+1]==7||WJmap[r][c+1]==6)
{
if(WJmap[r][c+2]==0||WJmap[r][c+2]==3)
{
WJmap[r][c+2]+=4;
WJmap[r][c+1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 72:
if(WJmap[l-1][m]==0||WJmap[l-1][m]==3||WJmap[l-1][m]==5)
{
WJmap[l-1][m]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l-1][m]==4||WJmap[l-1][m]==7||WJmap[l-1][m]==5)
{
if(WJmap[l-2][m]==0||WJmap[l-2][m]==3)
{
WJmap[l-2][m]+=4;
WJmap[l-1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 80:
if(WJmap[l+1][m]==0||WJmap[l+1][m]==3||WJmap[l+1][m]==5)
{
WJmap[l+1][m]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l+1][m]==4||WJmap[l+1][m]==7||WJmap[l+1][m]==5)
{
if(WJmap[l+2][m]==0||WJmap[l+2][m]==3)
{
WJmap[l+2][m]+=4;
WJmap[l+1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 75:
if(WJmap[l][m-1]==0||WJmap[l][m-1]==3||WJmap[l][m-1]==5)
{
WJmap[l][m-1]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l][m-1]==4||WJmap[l][m-1]==7||WJmap[l][m-1]==5)
{
if(WJmap[l][m-2]==0||WJmap[l][m-2]==3)
{
WJmap[l][m-2]+=4;
WJmap[l][m-1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 77:
if(WJmap[l][m+1]==0||WJmap[l][m+1]==3||WJmap[l][m+1]==5)
{
WJmap[l][m+1]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l][m+1]==4||WJmap[l][m+1]==7||WJmap[l][m+1]==5)
{
if(WJmap[l][m+2]==0||WJmap[l][m+2]==3)
{
WJmap[l][m+2]+=4;
WJmap[l][m+1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WPmap[i][j]==5||WPmap[i][j]==8||WPmap[i][j]==11)
{
r=i;
c=j;
}
if(WPmap[i][j]==6||WPmap[i][j]==9||WPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(WPmap[r-1][c]==0||WPmap[r-1][c]==3||WPmap[r-1][c]==6)
{
WPmap[r-1][c]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r-1][c]==4||WPmap[r-1][c]==7||WPmap[r-1][c]==6)
{
if(WPmap[r-2][c]==0||WPmap[r-2][c]==3)
{
WPmap[r-2][c]+=4;
WPmap[r-1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WPmap[r+1][c]==0||WPmap[r+1][c]==3||WPmap[r+1][c]==6)
{
WPmap[r+1][c]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r+1][c]==4||WPmap[r+1][c]==7||WPmap[r+1][c]==6)
{
if(WPmap[r+2][c]==0||WPmap[r+2][c]==3)
{
WPmap[r+2][c]+=4;
WPmap[r+1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WPmap[r][c-1]==0||WPmap[r][c-1]==3||WPmap[r][c-1]==6)
{
WPmap[r][c-1]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r][c-1]==4||WPmap[r][c-1]==7||WPmap[r][c-1]==6)
{
if(WPmap[r][c-2]==0||WPmap[r][c-2]==3)
{
WPmap[r][c-2]+=4;
WPmap[r][c-1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WPmap[r][c+1]==0||WPmap[r][c+1]==3||WPmap[r][c+1]==6)
{
WPmap[r][c+1]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r][c+1]==4||WPmap[r][c+1]==7||WPmap[r][c+1]==6)
{
if(WPmap[r][c+2]==0||WPmap[r][c+2]==3)
{
WPmap[r][c+2]+=4;
WPmap[r][c+1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 72:
if(WPmap[l-1][m]==0||WPmap[l-1][m]==3||WPmap[l-1][m]==5)
{
WPmap[l-1][m]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l-1][m]==4||WPmap[l-1][m]==7||WPmap[l-1][m]==5)
{
if(WPmap[l-2][m]==0||WPmap[l-2][m]==3)
{
WPmap[l-2][m]+=4;
WPmap[l-1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 80:
if(WPmap[l+1][m]==0||WPmap[l+1][m]==3||WPmap[l+1][m]==5)
{
WPmap[l+1][m]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if(WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m-1]==4||WPmap[l][m-1]==7||WPmap[l][m-1]==5)
{
if(WPmap[l][m-2]==0||WPmap[l][m-2]==3)
{
WPmap[l][m-2]+=4;
WPmap[l][m-1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 77:
if(WPmap[l][m+1]==0||WPmap[l][m+1]==3||WPmap[l][m+1]==5)
{
WPmap[l][m+1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m+1]==4||WPmap[l][m+1]==7||WPmap[l][m+1]==5)
{
if(WPmap[l][m+2]==0||WPmap[l][m+2]==3)
{
WPmap[l][m+2]+=4;
WPmap[l][m+1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WKmap[i][j]==5||WKmap[i][j]==8||WKmap[i][j]==11)
{
r=i;
c=j;
}
if(WKmap[i][j]==6||WKmap[i][j]==9||WKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(WKmap[r-1][c]==0||WKmap[r-1][c]==3||WKmap[r-1][c]==6)
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r-1][c]==4||WKmap[r-1][c]==7||WKmap[r-1][c]==6)
{
if(WKmap[r-2][c]==0||WKmap[r-2][c]==3)
{
WKmap[r-2][c]+=4;
WKmap[r-1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WKmap[r+1][c]==0||WKmap[r+1][c]==3||WKmap[r+1][c]==6)
{
WKmap[r+1][c]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r+1][c]==4||WKmap[r+1][c]==7||WKmap[r+1][c]==6)
{
if(WKmap[r+2][c]==0||WKmap[r+2][c]==3)
{
WKmap[r+2][c]+=4;
WKmap[r+1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WKmap[r][c-1]==0||WKmap[r][c-1]==3||WKmap[r][c-1]==6)
{
WKmap[r][c-1]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r][c-1]==4||WKmap[r][c-1]==7||WKmap[r][c-1]==6)
{
if(WKmap[r][c-2]==0||WKmap[r][c-2]==3)
{
WKmap[r][c-2]+=4;
WKmap[r][c-1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WKmap[r][c+1]==0||WKmap[r][c+1]==3||WKmap[r][c+1]==6)
{
WKmap[r][c+1]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r][c+1]==4||WKmap[r][c+1]==7||WKmap[r][c+1]==6)
{
if(WKmap[r][c+2]==0||WKmap[r][c+2]==3)
{
WKmap[r][c+2]+=4;
WKmap[r][c+1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 72:
if(WKmap[l-1][m]==0||WKmap[l-1][m]==3||WKmap[l-1][m]==5)
{
WKmap[l-1][m]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l-1][m]==4||WKmap[l-1][m]==7||WKmap[l-1][m]==5)
{
if(WKmap[l-2][m]==0||WKmap[l-2][m]==3)
{
WKmap[l-2][m]+=4;
WKmap[l-1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 80:
if(WKmap[l+1][m]==0||WKmap[l+1][m]==3||WKmap[l+1][m]==5)
{
WKmap[l+1][m]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l+1][m]==4||WKmap[l+1][m]==7||WKmap[l+1][m]==5)
{
if(WKmap[l+2][m]==0||WKmap[l+2][m]==3)
{
WKmap[l+2][m]+=4;
WKmap[l+1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 75:
if(WKmap[l][m-1]==0||WKmap[l][m-1]==3||WKmap[l][m-1]==5)
{
WKmap[l][m-1]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l][m-1]==4||WKmap[l][m-1]==7||WKmap[l][m-1]==5)
{
if(WKmap[l][m-2]==0||WKmap[l][m-2]==3)
{
WKmap[l][m-2]+=4;
WKmap[l][m-1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 77:
if(WKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)
{
WKmap[l][m+1]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l][m+1]==4||WKmap[l][m+1]==7||WKmap[l][m+1]==5)
{
if(WKmap[l][m+2]==0||WKmap[l][m+2]==3)
{
WKmap[l][m+2]+=4;
WKmap[l][m+1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TLmap[i][j]==5||TLmap[i][j]==8||TLmap[i][j]==11)
{
r=i;
c=j;
}
if(TLmap[i][j]==6||TLmap[i][j]==9||TLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TLmap[r-1][c]==0||TLmap[r-1][c]==3||TLmap[r-1][c]==6)
{
TLmap[r-1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r-1][c]==4||TLmap[r-1][c]==7||TLmap[r-1][c]==6)
{
if(TLmap[r-2][c]==0||TLmap[r-2][c]==3)
{
TLmap[r-2][c]+=4;
TLmap[r-1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TLmap[r+1][c]==0||TLmap[r+1][c]==3||TLmap[r+1][c]==6)
{
TLmap[r+1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r+1][c]==4||TLmap[r+1][c]==7||TLmap[r+1][c]==6)
{
if(TLmap[r+2][c]==0||TLmap[r+2][c]==3)
{
TLmap[r+2][c]+=4;
TLmap[r+1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TLmap[r][c-1]==0||TLmap[r][c-1]==3||TLmap[r][c-1]==6)
{
TLmap[r][c-1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c-1]==4||TLmap[r][c-1]==7||TLmap[r][c-1]==6)
{
if(TLmap[r][c-2]==0||TLmap[r][c-2]==3)
{
TLmap[r][c-2]+=4;
TLmap[r][c-1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TLmap[r][c+1]==0||TLmap[r][c+1]==3||TLmap[r][c+1]==6)
{
TLmap[r][c+1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c+1]==4||TLmap[r][c+1]==7||TLmap[r][c+1]==6)
{
if(TLmap[r][c+2]==0||TLmap[r][c+2]==3)
{
TLmap[r][c+2]+=4;
TLmap[r][c+1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 72:
if(TLmap[l-1][m]==0||TLmap[l-1][m]==3||TLmap[l-1][m]==5)
{
TLmap[l-1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l-1][m]==4||TLmap[l-1][m]==7||TLmap[l-1][m]==5)
{
if(TLmap[l-2][m]==0||TLmap[l-2][m]==3)
{
TLmap[l-2][m]+=4;
TLmap[l-1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 80:
if(TLmap[l+1][m]==0||TLmap[l+1][m]==3||TLmap[l+1][m]==5)
{
TLmap[l+1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l+1][m]==4||TLmap[l+1][m]==7||TLmap[l+1][m]==5)
{
if(TLmap[l+2][m]==0||TLmap[l+2][m]==3)
{
TLmap[l+2][m]+=4;
TLmap[l+1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 75:
if(TLmap[l][m-1]==0||TLmap[l][m-1]==3||TLmap[l][m-1]==5)
{
TLmap[l][m-1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m-1]==4||TLmap[l][m-1]==7||TLmap[l][m-1]==5)
{
if(TLmap[l][m-2]==0||TLmap[l][m-2]==3)
{
TLmap[l][m-2]+=4;
TLmap[l][m-1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 77:
if(TLmap[l][m+1]==0||TLmap[l][m+1]==3||TLmap[l][m+1]==5)
{
TLmap[l][m+1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m+1]==4||TLmap[l][m+1]==7||TLmap[l][m+1]==5)
{
if(TLmap[l][m+2]==0||TLmap[l][m+2]==3)
{
TLmap[l][m+2]+=4;
TLmap[l][m+1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TSmap[i][j]==5||TSmap[i][j]==8||TSmap[i][j]==11)
{
r=i;
c=j;
}
if(TSmap[i][j]==6||TSmap[i][j]==9||TSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TSmap[r-1][c]==0||TSmap[r-1][c]==3||TSmap[r-1][c]==6)
{
TSmap[r-1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r-1][c]==4||TSmap[r-1][c]==7||TSmap[r-1][c]==6)
{
if(TSmap[r-2][c]==0||TSmap[r-2][c]==3)
{
TSmap[r-2][c]+=4;
TSmap[r-1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TSmap[r+1][c]==0||TSmap[r+1][c]==3||TSmap[r+1][c]==6)
{
TSmap[r+1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r+1][c]==4||TSmap[r+1][c]==7||TSmap[r+1][c]==6)
{
if(TSmap[r+2][c]==0||TSmap[r+2][c]==3)
{
TSmap[r+2][c]+=4;
TSmap[r+1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TSmap[r][c-1]==0||TSmap[r][c-1]==3||TSmap[r][c-1]==6)
{
TSmap[r][c-1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c-1]==4||TSmap[r][c-1]==7||TSmap[r][c-1]==6)
{
if(TSmap[r][c-2]==0||TSmap[r][c-2]==3)
{
TSmap[r][c-2]+=4;
TSmap[r][c-1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TSmap[r][c+1]==0||TSmap[r][c+1]==3||TSmap[r][c+1]==6)
{
TSmap[r][c+1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c+1]==4||TSmap[r][c+1]==7||TSmap[r][c+1]==6)
{
if(TSmap[r][c+2]==0||TSmap[r][c+2]==3)
{
TSmap[r][c+2]+=4;
TSmap[r][c+1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 72:
if(TSmap[l-1][m]==0||TSmap[l-1][m]==3||TSmap[l-1][m]==5)
{
TSmap[l-1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l-1][m]==4||TSmap[l-1][m]==7||TSmap[l-1][m]==5)
{
if(TSmap[l-2][m]==0||TSmap[l-2][m]==3)
{
TSmap[l-2][m]+=4;
TSmap[l-1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 80:
if(TSmap[l+1][m]==0||TSmap[l+1][m]==3||TSmap[l+1][m]==5)
{
TSmap[l+1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l+1][m]==4||TSmap[l+1][m]==7||TSmap[l+1][m]==5)
{
if(TSmap[l+2][m]==0||TSmap[l+2][m]==3)
{
TSmap[l+2][m]+=4;
TSmap[l+1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 75:
if(TSmap[l][m-1]==0||TSmap[l][m-1]==3||TSmap[l][m-1]==5)
{
TSmap[l][m-1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m-1]==4||TSmap[l][m-1]==7||TSmap[l][m-1]==5)
{
if(TSmap[l][m-2]==0||TSmap[l][m-2]==3)
{
TSmap[l][m-2]+=4;
TSmap[l][m-1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 77:
if(TSmap[l][m+1]==0||TSmap[l][m+1]==3||TSmap[l][m+1]==5)
{
TSmap[l][m+1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m+1]==4||TSmap[l][m+1]==7||TSmap[l][m+1]==5)
{
if(TSmap[l][m+2]==0||TSmap[l][m+2]==3)
{
TSmap[l][m+2]+=4;
TSmap[l][m+1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TYmap[i][j]==5||TYmap[i][j]==8||TYmap[i][j]==11)
{
r=i;
c=j;
}
if(TYmap[i][j]==6||TYmap[i][j]==9||TYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TYmap[r-1][c]==0||TYmap[r-1][c]==3||TYmap[r-1][c]==6)
{
TYmap[r-1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r-1][c]==4||TYmap[r-1][c]==7||TYmap[r-1][c]==6)
{
if(TYmap[r-2][c]==0||TYmap[r-2][c]==3)
{
TYmap[r-2][c]+=4;
TYmap[r-1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TYmap[r+1][c]==0||TYmap[r+1][c]==3||TYmap[r+1][c]==6)
{
TYmap[r+1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r+1][c]==4||TYmap[r+1][c]==7||TYmap[r+1][c]==6)
{
if(TYmap[r+2][c]==0||TYmap[r+2][c]==3)
{
TYmap[r+2][c]+=4;
TYmap[r+1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TYmap[r][c-1]==0||TYmap[r][c-1]==3||TYmap[r][c-1]==6)
{
TYmap[r][c-1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c-1]==4||TYmap[r][c-1]==7||TYmap[r][c-1]==6)
{
if(TYmap[r][c-2]==0||TYmap[r][c-2]==3)
{
TYmap[r][c-2]+=4;
TYmap[r][c-1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TYmap[r][c+1]==0||TYmap[r][c+1]==3||TYmap[r][c+1]==6)
{
TYmap[r][c+1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c+1]==4||TYmap[r][c+1]==7||TYmap[r][c+1]==6)
{
if(TYmap[r][c+2]==0||TYmap[r][c+2]==3)
{
TYmap[r][c+2]+=4;
TYmap[r][c+1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 72:
if(TYmap[l-1][m]==0||TYmap[l-1][m]==3||TYmap[l-1][m]==5)
{
TYmap[l-1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l-1][m]==4||TYmap[l-1][m]==7||TYmap[l-1][m]==5)
{
if(TYmap[l-2][m]==0||TYmap[l-2][m]==3)
{
TYmap[l-2][m]+=4;
TYmap[l-1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 80:
if(TYmap[l+1][m]==0||TYmap[l+1][m]==3||TYmap[l+1][m]==5)
{
TYmap[l+1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l+1][m]==4||TYmap[l+1][m]==7||TYmap[l+1][m]==5)
{
if(TYmap[l+2][m]==0||TYmap[l+2][m]==3)
{
TYmap[l+2][m]+=4;
TYmap[l+1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 75:
if(TYmap[l][m-1]==0||TYmap[l][m-1]==3||TYmap[l][m-1]==5)
{
TYmap[l][m-1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m-1]==4||TYmap[l][m-1]==7||TYmap[l][m-1]==5)
{
if(TYmap[l][m-2]==0||TYmap[l][m-2]==3)
{
TYmap[l][m-2]+=4;
TYmap[l][m-1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 77:
if(TYmap[l][m+1]==0||TYmap[l][m+1]==3||TYmap[l][m+1]==5)
{
TYmap[l][m+1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m+1]==4||TYmap[l][m+1]==7||TYmap[l][m+1]==5)
{
if(TYmap[l][m+2]==0||TYmap[l][m+2]==3)
{
TYmap[l][m+2]+=4;
TYmap[l][m+1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
}
else if(g==2)
{
//1人模式
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WJmap[i][j]==5||WJmap[i][j]==8||WJmap[i][j]==11)
{
r=i;
c=j;
}
if(WJmap[i][j]==6||WJmap[i][j]==9||WJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(WJmap[r-1][c]==0||WJmap[r-1][c]==3||WJmap[r-1][c]==6)
{
WJmap[r-1][c]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r-1][c]==4||WJmap[r-1][c]==7||WJmap[r-1][c]==6)
{
if(WJmap[r-2][c]==0||WJmap[r-2][c]==3)
{
WJmap[r-2][c]+=4;
WJmap[r-1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WJmap[r+1][c]==0||WJmap[r+1][c]==3||WJmap[r+1][c]==6)
{
WJmap[r+1][c]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r+1][c]==4||WJmap[r+1][c]==7||WJmap[r+1][c]==6)
{
if(WJmap[r+2][c]==0||WJmap[r+2][c]==3)
{
WJmap[r+2][c]+=4;
WJmap[r+1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WJmap[r][c-1]==0||WJmap[r][c-1]==3||WJmap[r][c-1]==6)
{
WJmap[r][c-1]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r][c-1]==4||WJmap[r][c-1]==7||WJmap[r][c-1]==6)
{
if(WJmap[r][c-2]==0||WJmap[r][c-2]==3)
{
WJmap[r][c-2]+=4;
WJmap[r][c-1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WJmap[r][c+1]==0||WJmap[r][c+1]==3||WJmap[r][c+1]==6)
{
WJmap[r][c+1]+=5;
WJmap[r][c]-=5;
}
else if(WJmap[r][c+1]==4||WJmap[r][c+1]==7||WJmap[r][c+1]==6)
{
if(WJmap[r][c+2]==0||WJmap[r][c+2]==3)
{
WJmap[r][c+2]+=4;
WJmap[r][c+1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 72:
if(WJmap[l-1][m]==0||WJmap[l-1][m]==3||WJmap[l-1][m]==5)
{
WJmap[l-1][m]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l-1][m]==4||WJmap[l-1][m]==7||WJmap[l-1][m]==5)
{
if(WJmap[l-2][m]==0||WJmap[l-2][m]==3)
{
WJmap[l-2][m]+=4;
WJmap[l-1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 80:
if(WJmap[l+1][m]==0||WJmap[l+1][m]==3||WJmap[l+1][m]==5)
{
WJmap[l+1][m]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l+1][m]==4||WJmap[l+1][m]==7||WJmap[l+1][m]==5)
{
if(WJmap[l+2][m]==0||WJmap[l+2][m]==3)
{
WJmap[l+2][m]+=4;
WJmap[l+1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 75:
if(WJmap[l][m-1]==0||WJmap[l][m-1]==3||WJmap[l][m-1]==5)
{
WJmap[l][m-1]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l][m-1]==4||WJmap[l][m-1]==7||WJmap[l][m-1]==5)
{
if(WJmap[l][m-2]==0||WJmap[l][m-2]==3)
{
WJmap[l][m-2]+=4;
WJmap[l][m-1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 77:
if(WJmap[l][m+1]==0||WJmap[l][m+1]==3||WJmap[l][m+1]==5)
{
WJmap[l][m+1]+=6;
WJmap[l][m]-=6;
}
else if(WJmap[l][m+1]==4||WJmap[l][m+1]==7||WJmap[l][m+1]==5)
{
if(WJmap[l][m+2]==0||WJmap[l][m+2]==3)
{
WJmap[l][m+2]+=4;
WJmap[l][m+1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WPmap[i][j]==5||WPmap[i][j]==8||WPmap[i][j]==11)
{
r=i;
c=j;
}
if(WPmap[i][j]==6||WPmap[i][j]==9||WPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(WPmap[r-1][c]==0||WPmap[r-1][c]==3||WPmap[r-1][c]==6)
{
WPmap[r-1][c]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r-1][c]==4||WPmap[r-1][c]==7||WPmap[r-1][c]==6)
{
if(WPmap[r-2][c]==0||WPmap[r-2][c]==3)
{
WPmap[r-2][c]+=4;
WPmap[r-1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WPmap[r+1][c]==0||WPmap[r+1][c]==3||WPmap[r+1][c]==6)
{
WPmap[r+1][c]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r+1][c]==4||WPmap[r+1][c]==7||WPmap[r+1][c]==6)
{
if(WPmap[r+2][c]==0||WPmap[r+2][c]==3)
{
WPmap[r+2][c]+=4;
WPmap[r+1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WPmap[r][c-1]==0||WPmap[r][c-1]==3||WPmap[r][c-1]==6)
{
WPmap[r][c-1]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r][c-1]==4||WPmap[r][c-1]==7||WPmap[r][c-1]==6)
{
if(WPmap[r][c-2]==0||WPmap[r][c-2]==3)
{
WPmap[r][c-2]+=4;
WPmap[r][c-1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WPmap[r][c+1]==0||WPmap[r][c+1]==3||WPmap[r][c+1]==6)
{
WPmap[r][c+1]+=5;
WPmap[r][c]-=5;
}
else if(WPmap[r][c+1]==4||WPmap[r][c+1]==7||WPmap[r][c+1]==6)
{
if(WPmap[r][c+2]==0||WPmap[r][c+2]==3)
{
WPmap[r][c+2]+=4;
WPmap[r][c+1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 72:
if(WPmap[l-1][m]==0||WPmap[l-1][m]==3||WPmap[l-1][m]==5)
{
WPmap[l-1][m]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l-1][m]==4||WPmap[l-1][m]==7||WPmap[l-1][m]==5)
{
if(WPmap[l-2][m]==0||WPmap[l-2][m]==3)
{
WPmap[l-2][m]+=4;
WPmap[l-1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 80:
if(WPmap[l+1][m]==0||WPmap[l+1][m]==3||WPmap[l+1][m]==5)
{
WPmap[l+1][m]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if(WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m-1]==4||WPmap[l][m-1]==7||WPmap[l][m-1]==5)
{
if(WPmap[l][m-2]==0||WPmap[l][m-2]==3)
{
WPmap[l][m-2]+=4;
WPmap[l][m-1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 77:
if(WPmap[l][m+1]==0||WPmap[l][m+1]==3||WPmap[l][m+1]==5)
{
WPmap[l][m+1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m+1]==4||WPmap[l][m+1]==7||WPmap[l][m+1]==5)
{
if(WPmap[l][m+2]==0||WPmap[l][m+2]==3)
{
WPmap[l][m+2]+=4;
WPmap[l][m+1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WKmap[i][j]==5||WKmap[i][j]==8||WKmap[i][j]==11)
{
r=i;
c=j;
}
if(WKmap[i][j]==6||WKmap[i][j]==9||WKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(WKmap[r-1][c]==0||WKmap[r-1][c]==3||WKmap[r-1][c]==6)
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r-1][c]==4||WKmap[r-1][c]==7||WKmap[r-1][c]==6)
{
if(WKmap[r-2][c]==0||WKmap[r-2][c]==3)
{
WKmap[r-2][c]+=4;
WKmap[r-1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(WKmap[r+1][c]==0||WKmap[r+1][c]==3||WKmap[r+1][c]==6)
{
WKmap[r+1][c]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r+1][c]==4||WKmap[r+1][c]==7||WKmap[r+1][c]==6)
{
if(WKmap[r+2][c]==0||WKmap[r+2][c]==3)
{
WKmap[r+2][c]+=4;
WKmap[r+1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(WKmap[r][c-1]==0||WKmap[r][c-1]==3||WKmap[r][c-1]==6)
{
WKmap[r][c-1]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r][c-1]==4||WKmap[r][c-1]==7||WKmap[r][c-1]==6)
{
if(WKmap[r][c-2]==0||WKmap[r][c-2]==3)
{
WKmap[r][c-2]+=4;
WKmap[r][c-1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(WKmap[r][c+1]==0||WKmap[r][c+1]==3||WKmap[r][c+1]==6)
{
WKmap[r][c+1]+=5;
WKmap[r][c]-=5;
}
else if(WKmap[r][c+1]==4||WKmap[r][c+1]==7||WKmap[r][c+1]==6)
{
if(WKmap[r][c+2]==0||WKmap[r][c+2]==3)
{
WKmap[r][c+2]+=4;
WKmap[r][c+1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 72:
if(WKmap[l-1][m]==0||WKmap[l-1][m]==3||WKmap[l-1][m]==5)
{
WKmap[l-1][m]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l-1][m]==4||WKmap[l-1][m]==7||WKmap[l-1][m]==5)
{
if(WKmap[l-2][m]==0||WKmap[l-2][m]==3)
{
WKmap[l-2][m]+=4;
WKmap[l-1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 80:
if(WKmap[l+1][m]==0||WKmap[l+1][m]==3||WKmap[l+1][m]==5)
{
WKmap[l+1][m]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l+1][m]==4||WKmap[l+1][m]==7||WKmap[l+1][m]==5)
{
if(WKmap[l+2][m]==0||WKmap[l+2][m]==3)
{
WKmap[l+2][m]+=4;
WKmap[l+1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 75:
if(WKmap[l][m-1]==0||WKmap[l][m-1]==3||WKmap[l][m-1]==5)
{
WKmap[l][m-1]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l][m-1]==4||WKmap[l][m-1]==7||WKmap[l][m-1]==5)
{
if(WKmap[l][m-2]==0||WKmap[l][m-2]==3)
{
WKmap[l][m-2]+=4;
WKmap[l][m-1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 77:
if(WKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)
{
WKmap[l][m+1]+=6;
WKmap[l][m]-=6;
}
else if(WKmap[l][m+1]==4||WKmap[l][m+1]==7||WKmap[l][m+1]==5)
{
if(WKmap[l][m+2]==0||WKmap[l][m+2]==3)
{
WKmap[l][m+2]+=4;
WKmap[l][m+1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TLmap[i][j]==5||TLmap[i][j]==8||TLmap[i][j]==11)
{
r=i;
c=j;
}
if(TLmap[i][j]==6||TLmap[i][j]==9||TLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TLmap[r-1][c]==0||TLmap[r-1][c]==3||TLmap[r-1][c]==6)
{
TLmap[r-1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r-1][c]==4||TLmap[r-1][c]==7||TLmap[r-1][c]==6)
{
if(TLmap[r-2][c]==0||TLmap[r-2][c]==3)
{
TLmap[r-2][c]+=4;
TLmap[r-1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TLmap[r+1][c]==0||TLmap[r+1][c]==3||TLmap[r+1][c]==6)
{
TLmap[r+1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r+1][c]==4||TLmap[r+1][c]==7||TLmap[r+1][c]==6)
{
if(TLmap[r+2][c]==0||TLmap[r+2][c]==3)
{
TLmap[r+2][c]+=4;
TLmap[r+1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TLmap[r][c-1]==0||TLmap[r][c-1]==3||TLmap[r][c-1]==6)
{
TLmap[r][c-1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c-1]==4||TLmap[r][c-1]==7||TLmap[r][c-1]==6)
{
if(TLmap[r][c-2]==0||TLmap[r][c-2]==3)
{
TLmap[r][c-2]+=4;
TLmap[r][c-1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TLmap[r][c+1]==0||TLmap[r][c+1]==3||TLmap[r][c+1]==6)
{
TLmap[r][c+1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c+1]==4||TLmap[r][c+1]==7||TLmap[r][c+1]==6)
{
if(TLmap[r][c+2]==0||TLmap[r][c+2]==3)
{
TLmap[r][c+2]+=4;
TLmap[r][c+1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 72:
if(TLmap[l-1][m]==0||TLmap[l-1][m]==3||TLmap[l-1][m]==5)
{
TLmap[l-1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l-1][m]==4||TLmap[l-1][m]==7||TLmap[l-1][m]==5)
{
if(TLmap[l-2][m]==0||TLmap[l-2][m]==3)
{
TLmap[l-2][m]+=4;
TLmap[l-1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 80:
if(TLmap[l+1][m]==0||TLmap[l+1][m]==3||TLmap[l+1][m]==5)
{
TLmap[l+1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l+1][m]==4||TLmap[l+1][m]==7||TLmap[l+1][m]==5)
{
if(TLmap[l+2][m]==0||TLmap[l+2][m]==3)
{
TLmap[l+2][m]+=4;
TLmap[l+1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 75:
if(TLmap[l][m-1]==0||TLmap[l][m-1]==3||TLmap[l][m-1]==5)
{
TLmap[l][m-1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m-1]==4||TLmap[l][m-1]==7||TLmap[l][m-1]==5)
{
if(TLmap[l][m-2]==0||TLmap[l][m-2]==3)
{
TLmap[l][m-2]+=4;
TLmap[l][m-1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 77:
if(TLmap[l][m+1]==0||TLmap[l][m+1]==3||TLmap[l][m+1]==5)
{
TLmap[l][m+1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m+1]==4||TLmap[l][m+1]==7||TLmap[l][m+1]==5)
{
if(TLmap[l][m+2]==0||TLmap[l][m+2]==3)
{
TLmap[l][m+2]+=4;
TLmap[l][m+1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TSmap[i][j]==5||TSmap[i][j]==8||TSmap[i][j]==11)
{
r=i;
c=j;
}
if(TSmap[i][j]==6||TSmap[i][j]==9||TSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TSmap[r-1][c]==0||TSmap[r-1][c]==3||TSmap[r-1][c]==6)
{
TSmap[r-1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r-1][c]==4||TSmap[r-1][c]==7||TSmap[r-1][c]==6)
{
if(TSmap[r-2][c]==0||TSmap[r-2][c]==3)
{
TSmap[r-2][c]+=4;
TSmap[r-1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TSmap[r+1][c]==0||TSmap[r+1][c]==3||TSmap[r+1][c]==6)
{
TSmap[r+1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r+1][c]==4||TSmap[r+1][c]==7||TSmap[r+1][c]==6)
{
if(TSmap[r+2][c]==0||TSmap[r+2][c]==3)
{
TSmap[r+2][c]+=4;
TSmap[r+1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TSmap[r][c-1]==0||TSmap[r][c-1]==3||TSmap[r][c-1]==6)
{
TSmap[r][c-1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c-1]==4||TSmap[r][c-1]==7||TSmap[r][c-1]==6)
{
if(TSmap[r][c-2]==0||TSmap[r][c-2]==3)
{
TSmap[r][c-2]+=4;
TSmap[r][c-1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TSmap[r][c+1]==0||TSmap[r][c+1]==3||TSmap[r][c+1]==6)
{
TSmap[r][c+1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c+1]==4||TSmap[r][c+1]==7||TSmap[r][c+1]==6)
{
if(TSmap[r][c+2]==0||TSmap[r][c+2]==3)
{
TSmap[r][c+2]+=4;
TSmap[r][c+1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 72:
if(TSmap[l-1][m]==0||TSmap[l-1][m]==3||TSmap[l-1][m]==5)
{
TSmap[l-1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l-1][m]==4||TSmap[l-1][m]==7||TSmap[l-1][m]==5)
{
if(TSmap[l-2][m]==0||TSmap[l-2][m]==3)
{
TSmap[l-2][m]+=4;
TSmap[l-1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 80:
if(TSmap[l+1][m]==0||TSmap[l+1][m]==3||TSmap[l+1][m]==5)
{
TSmap[l+1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l+1][m]==4||TSmap[l+1][m]==7||TSmap[l+1][m]==5)
{
if(TSmap[l+2][m]==0||TSmap[l+2][m]==3)
{
TSmap[l+2][m]+=4;
TSmap[l+1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 75:
if(TSmap[l][m-1]==0||TSmap[l][m-1]==3||TSmap[l][m-1]==5)
{
TSmap[l][m-1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m-1]==4||TSmap[l][m-1]==7||TSmap[l][m-1]==5)
{
if(TSmap[l][m-2]==0||TSmap[l][m-2]==3)
{
TSmap[l][m-2]+=4;
TSmap[l][m-1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 77:
if(TSmap[l][m+1]==0||TSmap[l][m+1]==3||TSmap[l][m+1]==5)
{
TSmap[l][m+1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m+1]==4||TSmap[l][m+1]==7||TSmap[l][m+1]==5)
{
if(TSmap[l][m+2]==0||TSmap[l][m+2]==3)
{
TSmap[l][m+2]+=4;
TSmap[l][m+1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TYmap[i][j]==5||TYmap[i][j]==8||TYmap[i][j]==11)
{
r=i;
c=j;
}
if(TYmap[i][j]==6||TYmap[i][j]==9||TYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(TYmap[r-1][c]==0||TYmap[r-1][c]==3||TYmap[r-1][c]==6)
{
TYmap[r-1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r-1][c]==4||TYmap[r-1][c]==7||TYmap[r-1][c]==6)
{
if(TYmap[r-2][c]==0||TYmap[r-2][c]==3)
{
TYmap[r-2][c]+=4;
TYmap[r-1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TYmap[r+1][c]==0||TYmap[r+1][c]==3||TYmap[r+1][c]==6)
{
TYmap[r+1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r+1][c]==4||TYmap[r+1][c]==7||TYmap[r+1][c]==6)
{
if(TYmap[r+2][c]==0||TYmap[r+2][c]==3)
{
TYmap[r+2][c]+=4;
TYmap[r+1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TYmap[r][c-1]==0||TYmap[r][c-1]==3||TYmap[r][c-1]==6)
{
TYmap[r][c-1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c-1]==4||TYmap[r][c-1]==7||TYmap[r][c-1]==6)
{
if(TYmap[r][c-2]==0||TYmap[r][c-2]==3)
{
TYmap[r][c-2]+=4;
TYmap[r][c-1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TYmap[r][c+1]==0||TYmap[r][c+1]==3||TYmap[r][c+1]==6)
{
TYmap[r][c+1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c+1]==4||TYmap[r][c+1]==7||TYmap[r][c+1]==6)
{
if(TYmap[r][c+2]==0||TYmap[r][c+2]==3)
{
TYmap[r][c+2]+=4;
TYmap[r][c+1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 72:
if(TYmap[l-1][m]==0||TYmap[l-1][m]==3||TYmap[l-1][m]==5)
{
TYmap[l-1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l-1][m]==4||TYmap[l-1][m]==7||TYmap[l-1][m]==5)
{
if(TYmap[l-2][m]==0||TYmap[l-2][m]==3)
{
TYmap[l-2][m]+=4;
TYmap[l-1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 80:
if(TYmap[l+1][m]==0||TYmap[l+1][m]==3||TYmap[l+1][m]==5)
{
TYmap[l+1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l+1][m]==4||TYmap[l+1][m]==7||TYmap[l+1][m]==5)
{
if(TYmap[l+2][m]==0||TYmap[l+2][m]==3)
{
TYmap[l+2][m]+=4;
TYmap[l+1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 75:
if(TYmap[l][m-1]==0||TYmap[l][m-1]==3||TYmap[l][m-1]==5)
{
TYmap[l][m-1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m-1]==4||TYmap[l][m-1]==7||TYmap[l][m-1]==5)
{
if(TYmap[l][m-2]==0||TYmap[l][m-2]==3)
{
TYmap[l][m-2]+=4;
TYmap[l][m-1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 77:
if(TYmap[l][m+1]==0||TYmap[l][m+1]==3||TYmap[l][m+1]==5)
{
TYmap[l][m+1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m+1]==4||TYmap[l][m+1]==7||TYmap[l][m+1]==5)
{
if(TYmap[l][m+2]==0||TYmap[l][m+2]==3)
{
TYmap[l][m+2]+=4;
TYmap[l][m+1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
}
else if(g==3)
{
//1人导弹模式(无坐标)
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WJmap[i][j]==5||WJmap[i][j]==8||WJmap[i][j]==11)
{
r=i;
c=j;
}
if(WJmap[i][j]==6||WJmap[i][j]==9||WJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WJmap[r][c]==WJmap[x][y]) z1=0;
if(z1==0)
{
WJmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WJmap[r-1][c]==0||WJmap[r-1][c]==3||WJmap[r-1][c]==6)&&(z1==1))
{
WJmap[r-1][c]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r-1][c]==4||WJmap[r-1][c]==7||WJmap[r-1][c]==6)&&(z1==1))
{
if((WJmap[r-2][c]==0||WJmap[r-2][c]==3)&&(z1==1))
{
WJmap[r-2][c]+=4;
WJmap[r-1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WJmap[r+1][c]==0||WJmap[r+1][c]==3||WJmap[r+1][c]==6)&&(z1==1))
{
WJmap[r+1][c]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r+1][c]==4||WJmap[r+1][c]==7||WJmap[r+1][c]==6)&&(z1==1))
{
if(WJmap[r+2][c]==0||WJmap[r+2][c]==3)
{
WJmap[r+2][c]+=4;
WJmap[r+1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WJmap[r][c-1]==0||WJmap[r][c-1]==3||WJmap[r][c-1]==6)&&(z1==1))
{
WJmap[r][c-1]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r][c-1]==4||WJmap[r][c-1]==7||WJmap[r][c-1]==6)&&(z1==1))
{
if(WJmap[r][c-2]==0||WJmap[r][c-2]==3)
{
WJmap[r][c-2]+=4;
WJmap[r][c-1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WJmap[r][c+1]==0||WJmap[r][c+1]==3||WJmap[r][c+1]==6)&&(z1==1))
{
WJmap[r][c+1]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r][c+1]==4||WJmap[r][c+1]==7||WJmap[r][c+1]==6)&&(z1==1))
{
if(WJmap[r][c+2]==0||WJmap[r][c+2]==3)
{
WJmap[r][c+2]+=4;
WJmap[r][c+1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 72:
if((WJmap[l-1][m]==0||WJmap[l-1][m]==3||WJmap[l-1][m]==5)&&(z2==1))
{
WJmap[l-1][m]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l-1][m]==4||WJmap[l-1][m]==7||WJmap[l-1][m]==5)&&(z2==1))
{
if(WJmap[l-2][m]==0||WJmap[l-2][m]==3)
{
WJmap[l-2][m]+=4;
WJmap[l-1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 80:
if((WJmap[l+1][m]==0||WJmap[l+1][m]==3||WJmap[l+1][m]==5)&&(z2==1))
{
WJmap[l+1][m]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l+1][m]==4||WJmap[l+1][m]==7||WJmap[l+1][m]==5)&&(z2==1))
{
if(WJmap[l+2][m]==0||WJmap[l+2][m]==3)
{
WJmap[l+2][m]+=4;
WJmap[l+1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 75:
if((WJmap[l][m-1]==0||WJmap[l][m-1]==3||WJmap[l][m-1]==5)&&(z2==1))
{
WJmap[l][m-1]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l][m-1]==4||WJmap[l][m-1]==7||WJmap[l][m-1]==5)&&(z2==1))
{
if(WJmap[l][m-2]==0||WJmap[l][m-2]==3)
{
WJmap[l][m-2]+=4;
WJmap[l][m-1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 77:
if((WJmap[l][m+1]==0||WJmap[l][m+1]==3||WJmap[l][m+1]==5)&&(z2==1))
{
WJmap[l][m+1]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l][m+1]==4||WJmap[l][m+1]==7||WJmap[l][m+1]==5)&&(z2==1))
{
if(WJmap[l][m+2]==0||WJmap[l][m+2]==3)
{
WJmap[l][m+2]+=4;
WJmap[l][m+1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WPmap[i][j]==5||WPmap[i][j]==8||WPmap[i][j]==11)
{
r=i;
c=j;
}
if(WPmap[i][j]==6||WPmap[i][j]==9||WPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WPmap[r][c]==WPmap[x][y]) z1=0;
if(z1==0)
{
WPmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WPmap[r-1][c]==0||WPmap[r-1][c]==3||WPmap[r-1][c]==6)&&(z1==1))
{
WPmap[r-1][c]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r-1][c]==4||WPmap[r-1][c]==7||WPmap[r-1][c]==6)&&(z1==1))
{
if((WPmap[r-2][c]==0||WPmap[r-2][c]==3)&&(z1==1))
{
WPmap[r-2][c]+=4;
WPmap[r-1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WPmap[r+1][c]==0||WPmap[r+1][c]==3||WPmap[r+1][c]==6)&&(z1==1))
{
WPmap[r+1][c]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r+1][c]==4||WPmap[r+1][c]==7||WPmap[r+1][c]==6)&&(z1==1))
{
if(WPmap[r+2][c]==0||WPmap[r+2][c]==3)
{
WPmap[r+2][c]+=4;
WPmap[r+1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WPmap[r][c-1]==0||WPmap[r][c-1]==3||WPmap[r][c-1]==6)&&(z1==1))
{
WPmap[r][c-1]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r][c-1]==4||WPmap[r][c-1]==7||WPmap[r][c-1]==6)&&(z1==1))
{
if(WPmap[r][c-2]==0||WPmap[r][c-2]==3)
{
WPmap[r][c-2]+=4;
WPmap[r][c-1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WPmap[r][c+1]==0||WPmap[r][c+1]==3||WPmap[r][c+1]==6)&&(z1==1))
{
WPmap[r][c+1]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r][c+1]==4||WPmap[r][c+1]==7||WPmap[r][c+1]==6)&&(z1==1))
{
if(WPmap[r][c+2]==0||WPmap[r][c+2]==3)
{
WPmap[r][c+2]+=4;
WPmap[r][c+1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 72:
if((WPmap[l-1][m]==0||WPmap[l-1][m]==3||WPmap[l-1][m]==5)&&(z2==1))
{
WPmap[l-1][m]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l-1][m]==4||WPmap[l-1][m]==7||WPmap[l-1][m]==5)&&(z2==1))
{
if(WPmap[l-2][m]==0||WPmap[l-2][m]==3)
{
WPmap[l-2][m]+=4;
WPmap[l-1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 80:
if((WPmap[l+1][m]==0||WPmap[l+1][m]==3||WPmap[l+1][m]==5)&&(z2==1))
{
WPmap[l+1][m]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l][m-1]==4||WPmap[l][m-1]==7||WPmap[l][m-1]==5)&&(z2==1))
{
if(WPmap[l][m-2]==0||WPmap[l][m-2]==3)
{
WPmap[l][m-2]+=4;
WPmap[l][m-1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 77:
if((WPmap[l][m+1]==0||WPmap[l][m+1]==3||WPmap[l][m+1]==5)&&(z2==1))
{
WPmap[l][m+1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m+1]==4||WPmap[l][m+1]==7||WPmap[l][m+1]==5)
{
if(WPmap[l][m+2]==0||WPmap[l][m+2]==3)
{
WPmap[l][m+2]+=4;
WPmap[l][m+1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WKmap[i][j]==5||WKmap[i][j]==8||WKmap[i][j]==11)
{
r=i;
c=j;
}
if(WKmap[i][j]==6||WKmap[i][j]==9||WKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WKmap[r][c]==WKmap[x][y]) z1=0;
if(z1==0)
{
WKmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WKmap[r-1][c]==0||WKmap[r-1][c]==3||WKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r-1][c]==4||WKmap[r-1][c]==7||WKmap[r-1][c]==6)&&(z1==1))
{
if(WKmap[r-2][c]==0||WKmap[r-2][c]==3)
{
WKmap[r-2][c]+=4;
WKmap[r-1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WKmap[r+1][c]==0||WKmap[r+1][c]==3||WKmap[r+1][c]==6)&&(z1==1))
{
WKmap[r+1][c]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r+1][c]==4||WKmap[r+1][c]==7||WKmap[r+1][c]==6)&&(z1==1))
{
if(WKmap[r+2][c]==0||WKmap[r+2][c]==3)
{
WKmap[r+2][c]+=4;
WKmap[r+1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WKmap[r][c-1]==0||WKmap[r][c-1]==3||WKmap[r][c-1]==6)&&(z1==1))
{
WKmap[r][c-1]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r][c-1]==4||WKmap[r][c-1]==7||WKmap[r][c-1]==6)&&(z1==1))
{
if(WKmap[r][c-2]==0||WKmap[r][c-2]==3)
{
WKmap[r][c-2]+=4;
WKmap[r][c-1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WKmap[r][c+1]==0||WKmap[r][c+1]==3||WKmap[r][c+1]==6)&&(z1==1))
{
WKmap[r][c+1]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r][c+1]==4||WKmap[r][c+1]==7||WKmap[r][c+1]==6)&&(z2==1))
{
if(WKmap[r][c+2]==0||WKmap[r][c+2]==3)
{
WKmap[r][c+2]+=4;
WKmap[r][c+1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 72:
if((WKmap[l-1][m]==0||WKmap[l-1][m]==3||WKmap[l-1][m]==5)&&(z2==1))
{
WKmap[l-1][m]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l-1][m]==4||WKmap[l-1][m]==7||WKmap[l-1][m]==5)&&(z2==1))
{
if((WKmap[l-2][m]==0||WKmap[l-2][m]==3)&&(z2==1))
{
WKmap[l-2][m]+=4;
WKmap[l-1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 80:
if((WKmap[l+1][m]==0||WKmap[l+1][m]==3||WKmap[l+1][m]==5)&&(z2==1))
{
WKmap[l+1][m]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l+1][m]==4||WKmap[l+1][m]==7||WKmap[l+1][m]==5)&&(z2==1))
{
if(WKmap[l+2][m]==0||WKmap[l+2][m]==3)
{
WKmap[l+2][m]+=4;
WKmap[l+1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 75:
if((WKmap[l][m-1]==0||WKmap[l][m-1]==3||WKmap[l][m-1]==5)&&(z2==1))
{
WKmap[l][m-1]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l][m-1]==4||WKmap[l][m-1]==7||WKmap[l][m-1]==5)&&(z2==1))
{
if((WKmap[l][m-2]==0||WKmap[l][m-2]==3)&&(z2==1))
{
WKmap[l][m-2]+=4;
WKmap[l][m-1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 77:
if((WKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
WKmap[l][m+1]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l][m+1]==4||WKmap[l][m+1]==7||WKmap[l][m+1]==5)&&(z2==1))
{
if(WKmap[l][m+2]==0||WKmap[l][m+2]==3)
{
WKmap[l][m+2]+=4;
WKmap[l][m+1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TLmap[i][j]==5||TLmap[i][j]==8||TLmap[i][j]==11)
{
r=i;
c=j;
}
if(TLmap[i][j]==6||TLmap[i][j]==9||TLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TLmap[r][c]==TLmap[x][y]) z1=0;
if(z1==0)
{
TLmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TLmap[r-1][c]==0||TLmap[r-1][c]==3||TLmap[r-1][c]==6)
{
TLmap[r-1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r-1][c]==4||TLmap[r-1][c]==7||TLmap[r-1][c]==6)
{
if(TLmap[r-2][c]==0||TLmap[r-2][c]==3)
{
TLmap[r-2][c]+=4;
TLmap[r-1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TLmap[r+1][c]==0||TLmap[r+1][c]==3||TLmap[r+1][c]==6)
{
TLmap[r+1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r+1][c]==4||TLmap[r+1][c]==7||TLmap[r+1][c]==6)
{
if(TLmap[r+2][c]==0||TLmap[r+2][c]==3)
{
TLmap[r+2][c]+=4;
TLmap[r+1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TLmap[r][c-1]==0||TLmap[r][c-1]==3||TLmap[r][c-1]==6)
{
TLmap[r][c-1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c-1]==4||TLmap[r][c-1]==7||TLmap[r][c-1]==6)
{
if(TLmap[r][c-2]==0||TLmap[r][c-2]==3)
{
TLmap[r][c-2]+=4;
TLmap[r][c-1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TLmap[r][c+1]==0||TLmap[r][c+1]==3||TLmap[r][c+1]==6)
{
TLmap[r][c+1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c+1]==4||TLmap[r][c+1]==7||TLmap[r][c+1]==6)
{
if(TLmap[r][c+2]==0||TLmap[r][c+2]==3)
{
TLmap[r][c+2]+=4;
TLmap[r][c+1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 72:
if(TLmap[l-1][m]==0||TLmap[l-1][m]==3||TLmap[l-1][m]==5)
{
TLmap[l-1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l-1][m]==4||TLmap[l-1][m]==7||TLmap[l-1][m]==5)
{
if(TLmap[l-2][m]==0||TLmap[l-2][m]==3)
{
TLmap[l-2][m]+=4;
TLmap[l-1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 80:
if(TLmap[l+1][m]==0||TLmap[l+1][m]==3||TLmap[l+1][m]==5)
{
TLmap[l+1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l+1][m]==4||TLmap[l+1][m]==7||TLmap[l+1][m]==5)
{
if(TLmap[l+2][m]==0||TLmap[l+2][m]==3)
{
TLmap[l+2][m]+=4;
TLmap[l+1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 75:
if(TLmap[l][m-1]==0||TLmap[l][m-1]==3||TLmap[l][m-1]==5)
{
TLmap[l][m-1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m-1]==4||TLmap[l][m-1]==7||TLmap[l][m-1]==5)
{
if(TLmap[l][m-2]==0||TLmap[l][m-2]==3)
{
TLmap[l][m-2]+=4;
TLmap[l][m-1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 77:
if(TLmap[l][m+1]==0||TLmap[l][m+1]==3||TLmap[l][m+1]==5)
{
TLmap[l][m+1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m+1]==4||TLmap[l][m+1]==7||TLmap[l][m+1]==5)
{
if(TLmap[l][m+2]==0||TLmap[l][m+2]==3)
{
TLmap[l][m+2]+=4;
TLmap[l][m+1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TSmap[i][j]==5||TSmap[i][j]==8||TSmap[i][j]==11)
{
r=i;
c=j;
}
if(TSmap[i][j]==6||TSmap[i][j]==9||TSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TSmap[r][c]==TSmap[x][y]) z1=0;
if(z1==0)
{
TSmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TSmap[r-1][c]==0||TSmap[r-1][c]==3||TSmap[r-1][c]==6)
{
TSmap[r-1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r-1][c]==4||TSmap[r-1][c]==7||TSmap[r-1][c]==6)
{
if(TSmap[r-2][c]==0||TSmap[r-2][c]==3)
{
TSmap[r-2][c]+=4;
TSmap[r-1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TSmap[r+1][c]==0||TSmap[r+1][c]==3||TSmap[r+1][c]==6)
{
TSmap[r+1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r+1][c]==4||TSmap[r+1][c]==7||TSmap[r+1][c]==6)
{
if(TSmap[r+2][c]==0||TSmap[r+2][c]==3)
{
TSmap[r+2][c]+=4;
TSmap[r+1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TSmap[r][c-1]==0||TSmap[r][c-1]==3||TSmap[r][c-1]==6)
{
TSmap[r][c-1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c-1]==4||TSmap[r][c-1]==7||TSmap[r][c-1]==6)
{
if(TSmap[r][c-2]==0||TSmap[r][c-2]==3)
{
TSmap[r][c-2]+=4;
TSmap[r][c-1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TSmap[r][c+1]==0||TSmap[r][c+1]==3||TSmap[r][c+1]==6)
{
TSmap[r][c+1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c+1]==4||TSmap[r][c+1]==7||TSmap[r][c+1]==6)
{
if(TSmap[r][c+2]==0||TSmap[r][c+2]==3)
{
TSmap[r][c+2]+=4;
TSmap[r][c+1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 72:
if(TSmap[l-1][m]==0||TSmap[l-1][m]==3||TSmap[l-1][m]==5)
{
TSmap[l-1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l-1][m]==4||TSmap[l-1][m]==7||TSmap[l-1][m]==5)
{
if(TSmap[l-2][m]==0||TSmap[l-2][m]==3)
{
TSmap[l-2][m]+=4;
TSmap[l-1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 80:
if(TSmap[l+1][m]==0||TSmap[l+1][m]==3||TSmap[l+1][m]==5)
{
TSmap[l+1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l+1][m]==4||TSmap[l+1][m]==7||TSmap[l+1][m]==5)
{
if(TSmap[l+2][m]==0||TSmap[l+2][m]==3)
{
TSmap[l+2][m]+=4;
TSmap[l+1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 75:
if(TSmap[l][m-1]==0||TSmap[l][m-1]==3||TSmap[l][m-1]==5)
{
TSmap[l][m-1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m-1]==4||TSmap[l][m-1]==7||TSmap[l][m-1]==5)
{
if(TSmap[l][m-2]==0||TSmap[l][m-2]==3)
{
TSmap[l][m-2]+=4;
TSmap[l][m-1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 77:
if(TSmap[l][m+1]==0||TSmap[l][m+1]==3||TSmap[l][m+1]==5)
{
TSmap[l][m+1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m+1]==4||TSmap[l][m+1]==7||TSmap[l][m+1]==5)
{
if(TSmap[l][m+2]==0||TSmap[l][m+2]==3)
{
TSmap[l][m+2]+=4;
TSmap[l][m+1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TYmap[i][j]==5||TYmap[i][j]==8||TYmap[i][j]==11)
{
r=i;
c=j;
}
if(TYmap[i][j]==6||TYmap[i][j]==9||TYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TYmap[r][c]==TYmap[x][y]) z1=0;
if(z1==0)
{
TYmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TYmap[r-1][c]==0||TYmap[r-1][c]==3||TYmap[r-1][c]==6)
{
TYmap[r-1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r-1][c]==4||TYmap[r-1][c]==7||TYmap[r-1][c]==6)
{
if(TYmap[r-2][c]==0||TYmap[r-2][c]==3)
{
TYmap[r-2][c]+=4;
TYmap[r-1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TYmap[r+1][c]==0||TYmap[r+1][c]==3||TYmap[r+1][c]==6)
{
TYmap[r+1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r+1][c]==4||TYmap[r+1][c]==7||TYmap[r+1][c]==6)
{
if(TYmap[r+2][c]==0||TYmap[r+2][c]==3)
{
TYmap[r+2][c]+=4;
TYmap[r+1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TYmap[r][c-1]==0||TYmap[r][c-1]==3||TYmap[r][c-1]==6)
{
TYmap[r][c-1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c-1]==4||TYmap[r][c-1]==7||TYmap[r][c-1]==6)
{
if(TYmap[r][c-2]==0||TYmap[r][c-2]==3)
{
TYmap[r][c-2]+=4;
TYmap[r][c-1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TYmap[r][c+1]==0||TYmap[r][c+1]==3||TYmap[r][c+1]==6)
{
TYmap[r][c+1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c+1]==4||TYmap[r][c+1]==7||TYmap[r][c+1]==6)
{
if(TYmap[r][c+2]==0||TYmap[r][c+2]==3)
{
TYmap[r][c+2]+=4;
TYmap[r][c+1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 72:
if(TYmap[l-1][m]==0||TYmap[l-1][m]==3||TYmap[l-1][m]==5)
{
TYmap[l-1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l-1][m]==4||TYmap[l-1][m]==7||TYmap[l-1][m]==5)
{
if(TYmap[l-2][m]==0||TYmap[l-2][m]==3)
{
TYmap[l-2][m]+=4;
TYmap[l-1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 80:
if(TYmap[l+1][m]==0||TYmap[l+1][m]==3||TYmap[l+1][m]==5)
{
TYmap[l+1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l+1][m]==4||TYmap[l+1][m]==7||TYmap[l+1][m]==5)
{
if(TYmap[l+2][m]==0||TYmap[l+2][m]==3)
{
TYmap[l+2][m]+=4;
TYmap[l+1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 75:
if(TYmap[l][m-1]==0||TYmap[l][m-1]==3||TYmap[l][m-1]==5)
{
TYmap[l][m-1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m-1]==4||TYmap[l][m-1]==7||TYmap[l][m-1]==5)
{
if(TYmap[l][m-2]==0||TYmap[l][m-2]==3)
{
TYmap[l][m-2]+=4;
TYmap[l][m-1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 77:
if(TYmap[l][m+1]==0||TYmap[l][m+1]==3||TYmap[l][m+1]==5)
{
TYmap[l][m+1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m+1]==4||TYmap[l][m+1]==7||TYmap[l][m+1]==5)
{
if(TYmap[l][m+2]==0||TYmap[l][m+2]==3)
{
TYmap[l][m+2]+=4;
TYmap[l][m+1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
else if(g==4)
{
//2人模式
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWJmap[i][j]==5||DWJmap[i][j]==8||DWJmap[i][j]==11)
{
r=i;
c=j;
}
if(DWJmap[i][j]==6||DWJmap[i][j]==9||DWJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWJmap[r-1][c]==0||DWJmap[r-1][c]==3||DWJmap[r-1][c]==6)&&(z1==1))
{
DWJmap[r-1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r-1][c]==4||DWJmap[r-1][c]==7||DWJmap[r-1][c]==6)&&(z1==1))
{
if((DWJmap[r-2][c]==0||DWJmap[r-2][c]==3)&&(z1==1))
{
DWJmap[r-2][c]+=4;
DWJmap[r-1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWJmap[r+1][c]==0||DWJmap[r+1][c]==3||DWJmap[r+1][c]==6)&&(z1==1))
{
DWJmap[r+1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r+1][c]==4||DWJmap[r+1][c]==7||DWJmap[r+1][c]==6)&&(z1==1))
{
if(DWJmap[r+2][c]==0||DWJmap[r+2][c]==3)
{
DWJmap[r+2][c]+=4;
DWJmap[r+1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWJmap[r][c-1]==0||DWJmap[r][c-1]==3||DWJmap[r][c-1]==6)&&(z1==1))
{
DWJmap[r][c-1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c-1]==4||DWJmap[r][c-1]==7||DWJmap[r][c-1]==6)&&(z1==1))
{
if(DWJmap[r][c-2]==0||DWJmap[r][c-2]==3)
{
DWJmap[r][c-2]+=4;
DWJmap[r][c-1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWJmap[r][c+1]==0||DWJmap[r][c+1]==3||DWJmap[r][c+1]==6)&&(z1==1))
{
DWJmap[r][c+1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c+1]==4||DWJmap[r][c+1]==7||DWJmap[r][c+1]==6)&&(z1==1))
{
if(DWJmap[r][c+2]==0||DWJmap[r][c+2]==3)
{
DWJmap[r][c+2]+=4;
DWJmap[r][c+1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 72:
if((DWJmap[l-1][m]==0||DWJmap[l-1][m]==3||DWJmap[l-1][m]==5)&&(z2==1))
{
DWJmap[l-1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l-1][m]==4||DWJmap[l-1][m]==7||DWJmap[l-1][m]==5)&&(z2==1))
{
if(DWJmap[l-2][m]==0||DWJmap[l-2][m]==3)
{
DWJmap[l-2][m]+=4;
DWJmap[l-1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 80:
if((DWJmap[l+1][m]==0||DWJmap[l+1][m]==3||DWJmap[l+1][m]==5)&&(z2==1))
{
DWJmap[l+1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l+1][m]==4||DWJmap[l+1][m]==7||DWJmap[l+1][m]==5)&&(z2==1))
{
if(DWJmap[l+2][m]==0||DWJmap[l+2][m]==3)
{
DWJmap[l+2][m]+=4;
DWJmap[l+1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 75:
if((DWJmap[l][m-1]==0||DWJmap[l][m-1]==3||DWJmap[l][m-1]==5)&&(z2==1))
{
DWJmap[l][m-1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m-1]==4||DWJmap[l][m-1]==7||DWJmap[l][m-1]==5)&&(z2==1))
{
if(DWJmap[l][m-2]==0||DWJmap[l][m-2]==3)
{
DWJmap[l][m-2]+=4;
DWJmap[l][m-1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 77:
if((DWJmap[l][m+1]==0||DWJmap[l][m+1]==3||DWJmap[l][m+1]==5)&&(z2==1))
{
DWJmap[l][m+1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m+1]==4||DWJmap[l][m+1]==7||DWJmap[l][m+1]==5)&&(z2==1))
{
if(DWJmap[l][m+2]==0||DWJmap[l][m+2]==3)
{
DWJmap[l][m+2]+=4;
DWJmap[l][m+1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWPmap[i][j]==5||DWPmap[i][j]==8||DWPmap[i][j]==11)
{
r=i;
c=j;
}
if(DWPmap[i][j]==6||DWPmap[i][j]==9||DWPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWPmap[r-1][c]==0||DWPmap[r-1][c]==3||DWPmap[r-1][c]==6)&&(z1==1))
{
DWPmap[r-1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r-1][c]==4||DWPmap[r-1][c]==7||DWPmap[r-1][c]==6)&&(z1==1))
{
if((DWPmap[r-2][c]==0||DWPmap[r-2][c]==3)&&(z1==1))
{
DWPmap[r-2][c]+=4;
DWPmap[r-1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWPmap[r+1][c]==0||DWPmap[r+1][c]==3||DWPmap[r+1][c]==6)&&(z1==1))
{
DWPmap[r+1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r+1][c]==4||DWPmap[r+1][c]==7||DWPmap[r+1][c]==6)&&(z1==1))
{
if(DWPmap[r+2][c]==0||DWPmap[r+2][c]==3)
{
DWPmap[r+2][c]+=4;
DWPmap[r+1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWPmap[r][c-1]==0||DWPmap[r][c-1]==3||DWPmap[r][c-1]==6)&&(z1==1))
{
DWPmap[r][c-1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c-1]==4||DWPmap[r][c-1]==7||DWPmap[r][c-1]==6)&&(z1==1))
{
if(DWPmap[r][c-2]==0||DWPmap[r][c-2]==3)
{
DWPmap[r][c-2]+=4;
DWPmap[r][c-1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWPmap[r][c+1]==0||DWPmap[r][c+1]==3||DWPmap[r][c+1]==6)&&(z1==1))
{
DWPmap[r][c+1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c+1]==4||DWPmap[r][c+1]==7||DWPmap[r][c+1]==6)&&(z1==1))
{
if(DWPmap[r][c+2]==0||DWPmap[r][c+2]==3)
{
DWPmap[r][c+2]+=4;
DWPmap[r][c+1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 72:
if((DWPmap[l-1][m]==0||DWPmap[l-1][m]==3||DWPmap[l-1][m]==5)&&(z2==1))
{
DWPmap[l-1][m]+=6;
DWPmap[l][m]-=6;
}
else if((DWPmap[l-1][m]==4||DWPmap[l-1][m]==7||DWPmap[l-1][m]==5)&&(z2==1))
{
if(DWPmap[l-2][m]==0||DWPmap[l-2][m]==3)
{
DWPmap[l-2][m]+=4;
DWPmap[l-1][m]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 80:
if((DWPmap[l+1][m]==0||DWPmap[l+1][m]==3||DWPmap[l+1][m]==5)&&(z2==1))
{
DWPmap[l+1][m]+=6;
DWPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((DWPmap[l][m-1]==4||DWPmap[l][m-1]==7||DWPmap[l][m-1]==5)&&(z2==1))
{
if(DWPmap[l][m-2]==0||DWPmap[l][m-2]==3)
{
DWPmap[l][m-2]+=4;
DWPmap[l][m-1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 77:
if((DWPmap[l][m+1]==0||DWPmap[l][m+1]==3||DWPmap[l][m+1]==5)&&(z2==1))
{
DWPmap[l][m+1]+=6;
DWPmap[l][m]-=6;
}
else if(DWPmap[l][m+1]==4||DWPmap[l][m+1]==7||DWPmap[l][m+1]==5)
{
if(DWPmap[l][m+2]==0||DWPmap[l][m+2]==3)
{
DWPmap[l][m+2]+=4;
DWPmap[l][m+1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWKmap[i][j]==5||DWKmap[i][j]==8||DWKmap[i][j]==11)
{
r=i;
c=j;
}
if(DWKmap[i][j]==6||DWKmap[i][j]==9||DWKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWKmap[r-1][c]==0||DWKmap[r-1][c]==3||DWKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((DWKmap[r-1][c]==4||DWKmap[r-1][c]==7||DWKmap[r-1][c]==6)&&(z1==1))
{
if(DWKmap[r-2][c]==0||DWKmap[r-2][c]==3)
{
DWKmap[r-2][c]+=4;
DWKmap[r-1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWKmap[r+1][c]==0||DWKmap[r+1][c]==3||DWKmap[r+1][c]==6)&&(z1==1))
{
DWKmap[r+1][c]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r+1][c]==4||DWKmap[r+1][c]==7||DWKmap[r+1][c]==6)&&(z1==1))
{
if(DWKmap[r+2][c]==0||DWKmap[r+2][c]==3)
{
DWKmap[r+2][c]+=4;
DWKmap[r+1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWKmap[r][c-1]==0||DWKmap[r][c-1]==3||DWKmap[r][c-1]==6)&&(z1==1))
{
DWKmap[r][c-1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c-1]==4||DWKmap[r][c-1]==7||DWKmap[r][c-1]==6)&&(z1==1))
{
if(DWKmap[r][c-2]==0||DWKmap[r][c-2]==3)
{
DWKmap[r][c-2]+=4;
DWKmap[r][c-1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWKmap[r][c+1]==0||DWKmap[r][c+1]==3||DWKmap[r][c+1]==6)&&(z1==1))
{
DWKmap[r][c+1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c+1]==4||DWKmap[r][c+1]==7||DWKmap[r][c+1]==6)&&(z2==1))
{
if(DWKmap[r][c+2]==0||DWKmap[r][c+2]==3)
{
DWKmap[r][c+2]+=4;
DWKmap[r][c+1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 72:
if((DWKmap[l-1][m]==0||DWKmap[l-1][m]==3||DWKmap[l-1][m]==5)&&(z2==1))
{
DWKmap[l-1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l-1][m]==4||DWKmap[l-1][m]==7||DWKmap[l-1][m]==5)&&(z2==1))
{
if((DWKmap[l-2][m]==0||DWKmap[l-2][m]==3)&&(z2==1))
{
DWKmap[l-2][m]+=4;
DWKmap[l-1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 80:
if((DWKmap[l+1][m]==0||DWKmap[l+1][m]==3||DWKmap[l+1][m]==5)&&(z2==1))
{
DWKmap[l+1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l+1][m]==4||DWKmap[l+1][m]==7||DWKmap[l+1][m]==5)&&(z2==1))
{
if(DWKmap[l+2][m]==0||DWKmap[l+2][m]==3)
{
DWKmap[l+2][m]+=4;
DWKmap[l+1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 75:
if((DWKmap[l][m-1]==0||DWKmap[l][m-1]==3||DWKmap[l][m-1]==5)&&(z2==1))
{
DWKmap[l][m-1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m-1]==4||DWKmap[l][m-1]==7||DWKmap[l][m-1]==5)&&(z2==1))
{
if((DWKmap[l][m-2]==0||DWKmap[l][m-2]==3)&&(z2==1))
{
DWKmap[l][m-2]+=4;
DWKmap[l][m-1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 77:
if((DWKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
DWKmap[l][m+1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m+1]==4||DWKmap[l][m+1]==7||DWKmap[l][m+1]==5)&&(z2==1))
{
if(DWKmap[l][m+2]==0||DWKmap[l][m+2]==3)
{
DWKmap[l][m+2]+=4;
DWKmap[l][m+1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTLmap[i][j]==5||DTLmap[i][j]==8||DTLmap[i][j]==11)
{
r=i;
c=j;
}
if(DTLmap[i][j]==6||DTLmap[i][j]==9||DTLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTLmap[r-1][c]==0||DTLmap[r-1][c]==3||DTLmap[r-1][c]==6)
{
DTLmap[r-1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r-1][c]==4||DTLmap[r-1][c]==7||DTLmap[r-1][c]==6)
{
if(DTLmap[r-2][c]==0||DTLmap[r-2][c]==3)
{
DTLmap[r-2][c]+=4;
DTLmap[r-1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTLmap[r+1][c]==0||DTLmap[r+1][c]==3||DTLmap[r+1][c]==6)
{
DTLmap[r+1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r+1][c]==4||DTLmap[r+1][c]==7||DTLmap[r+1][c]==6)
{
if(DTLmap[r+2][c]==0||DTLmap[r+2][c]==3)
{
DTLmap[r+2][c]+=4;
DTLmap[r+1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTLmap[r][c-1]==0||DTLmap[r][c-1]==3||DTLmap[r][c-1]==6)
{
DTLmap[r][c-1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c-1]==4||DTLmap[r][c-1]==7||DTLmap[r][c-1]==6)
{
if(DTLmap[r][c-2]==0||DTLmap[r][c-2]==3)
{
DTLmap[r][c-2]+=4;
DTLmap[r][c-1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTLmap[r][c+1]==0||DTLmap[r][c+1]==3||DTLmap[r][c+1]==6)
{
DTLmap[r][c+1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c+1]==4||DTLmap[r][c+1]==7||DTLmap[r][c+1]==6)
{
if(DTLmap[r][c+2]==0||DTLmap[r][c+2]==3)
{
DTLmap[r][c+2]+=4;
DTLmap[r][c+1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 72:
if(DTLmap[l-1][m]==0||DTLmap[l-1][m]==3||DTLmap[l-1][m]==5)
{
DTLmap[l-1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l-1][m]==4||DTLmap[l-1][m]==7||DTLmap[l-1][m]==5)
{
if(DTLmap[l-2][m]==0||DTLmap[l-2][m]==3)
{
DTLmap[l-2][m]+=4;
DTLmap[l-1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 80:
if(DTLmap[l+1][m]==0||DTLmap[l+1][m]==3||DTLmap[l+1][m]==5)
{
DTLmap[l+1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l+1][m]==4||DTLmap[l+1][m]==7||DTLmap[l+1][m]==5)
{
if(DTLmap[l+2][m]==0||DTLmap[l+2][m]==3)
{
DTLmap[l+2][m]+=4;
DTLmap[l+1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 75:
if(DTLmap[l][m-1]==0||DTLmap[l][m-1]==3||DTLmap[l][m-1]==5)
{
DTLmap[l][m-1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m-1]==4||DTLmap[l][m-1]==7||DTLmap[l][m-1]==5)
{
if(DTLmap[l][m-2]==0||DTLmap[l][m-2]==3)
{
DTLmap[l][m-2]+=4;
DTLmap[l][m-1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 77:
if(DTLmap[l][m+1]==0||DTLmap[l][m+1]==3||DTLmap[l][m+1]==5)
{
DTLmap[l][m+1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m+1]==4||DTLmap[l][m+1]==7||DTLmap[l][m+1]==5)
{
if(DTLmap[l][m+2]==0||DTLmap[l][m+2]==3)
{
DTLmap[l][m+2]+=4;
DTLmap[l][m+1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTSmap[i][j]==5||DTSmap[i][j]==8||DTSmap[i][j]==11)
{
r=i;
c=j;
}
if(DTSmap[i][j]==6||DTSmap[i][j]==9||DTSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTSmap[r-1][c]==0||DTSmap[r-1][c]==3||DTSmap[r-1][c]==6)
{
DTSmap[r-1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r-1][c]==4||DTSmap[r-1][c]==7||DTSmap[r-1][c]==6)
{
if(DTSmap[r-2][c]==0||DTSmap[r-2][c]==3)
{
DTSmap[r-2][c]+=4;
DTSmap[r-1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTSmap[r+1][c]==0||DTSmap[r+1][c]==3||DTSmap[r+1][c]==6)
{
DTSmap[r+1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r+1][c]==4||DTSmap[r+1][c]==7||DTSmap[r+1][c]==6)
{
if(DTSmap[r+2][c]==0||DTSmap[r+2][c]==3)
{
DTSmap[r+2][c]+=4;
DTSmap[r+1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTSmap[r][c-1]==0||DTSmap[r][c-1]==3||DTSmap[r][c-1]==6)
{
DTSmap[r][c-1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c-1]==4||DTSmap[r][c-1]==7||DTSmap[r][c-1]==6)
{
if(DTSmap[r][c-2]==0||DTSmap[r][c-2]==3)
{
DTSmap[r][c-2]+=4;
DTSmap[r][c-1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTSmap[r][c+1]==0||DTSmap[r][c+1]==3||DTSmap[r][c+1]==6)
{
DTSmap[r][c+1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c+1]==4||DTSmap[r][c+1]==7||DTSmap[r][c+1]==6)
{
if(DTSmap[r][c+2]==0||DTSmap[r][c+2]==3)
{
DTSmap[r][c+2]+=4;
DTSmap[r][c+1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 72:
if(DTSmap[l-1][m]==0||DTSmap[l-1][m]==3||DTSmap[l-1][m]==5)
{
DTSmap[l-1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l-1][m]==4||DTSmap[l-1][m]==7||DTSmap[l-1][m]==5)
{
if(DTSmap[l-2][m]==0||DTSmap[l-2][m]==3)
{
DTSmap[l-2][m]+=4;
DTSmap[l-1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 80:
if(DTSmap[l+1][m]==0||DTSmap[l+1][m]==3||DTSmap[l+1][m]==5)
{
DTSmap[l+1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l+1][m]==4||DTSmap[l+1][m]==7||DTSmap[l+1][m]==5)
{
if(DTSmap[l+2][m]==0||DTSmap[l+2][m]==3)
{
DTSmap[l+2][m]+=4;
DTSmap[l+1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 75:
if(DTSmap[l][m-1]==0||DTSmap[l][m-1]==3||DTSmap[l][m-1]==5)
{
DTSmap[l][m-1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m-1]==4||DTSmap[l][m-1]==7||DTSmap[l][m-1]==5)
{
if(DTSmap[l][m-2]==0||DTSmap[l][m-2]==3)
{
DTSmap[l][m-2]+=4;
DTSmap[l][m-1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 77:
if(DTSmap[l][m+1]==0||DTSmap[l][m+1]==3||DTSmap[l][m+1]==5)
{
DTSmap[l][m+1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m+1]==4||DTSmap[l][m+1]==7||DTSmap[l][m+1]==5)
{
if(DTSmap[l][m+2]==0||DTSmap[l][m+2]==3)
{
DTSmap[l][m+2]+=4;
DTSmap[l][m+1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTYmap[i][j]==5||DTYmap[i][j]==8||DTYmap[i][j]==11)
{
r=i;
c=j;
}
if(DTYmap[i][j]==6||DTYmap[i][j]==9||DTYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTYmap[r-1][c]==0||DTYmap[r-1][c]==3||DTYmap[r-1][c]==6)
{
DTYmap[r-1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r-1][c]==4||DTYmap[r-1][c]==7||DTYmap[r-1][c]==6)
{
if(DTYmap[r-2][c]==0||DTYmap[r-2][c]==3)
{
DTYmap[r-2][c]+=4;
DTYmap[r-1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTYmap[r+1][c]==0||DTYmap[r+1][c]==3||DTYmap[r+1][c]==6)
{
DTYmap[r+1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r+1][c]==4||DTYmap[r+1][c]==7||DTYmap[r+1][c]==6)
{
if(DTYmap[r+2][c]==0||DTYmap[r+2][c]==3)
{
DTYmap[r+2][c]+=4;
DTYmap[r+1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTYmap[r][c-1]==0||DTYmap[r][c-1]==3||DTYmap[r][c-1]==6)
{
DTYmap[r][c-1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c-1]==4||DTYmap[r][c-1]==7||DTYmap[r][c-1]==6)
{
if(DTYmap[r][c-2]==0||DTYmap[r][c-2]==3)
{
DTYmap[r][c-2]+=4;
DTYmap[r][c-1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTYmap[r][c+1]==0||DTYmap[r][c+1]==3||DTYmap[r][c+1]==6)
{
DTYmap[r][c+1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c+1]==4||DTYmap[r][c+1]==7||DTYmap[r][c+1]==6)
{
if(DTYmap[r][c+2]==0||DTYmap[r][c+2]==3)
{
DTYmap[r][c+2]+=4;
DTYmap[r][c+1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 72:
if(DTYmap[l-1][m]==0||DTYmap[l-1][m]==3||DTYmap[l-1][m]==5)
{
DTYmap[l-1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l-1][m]==4||DTYmap[l-1][m]==7||DTYmap[l-1][m]==5)
{
if(DTYmap[l-2][m]==0||DTYmap[l-2][m]==3)
{
DTYmap[l-2][m]+=4;
DTYmap[l-1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 80:
if(DTYmap[l+1][m]==0||DTYmap[l+1][m]==3||DTYmap[l+1][m]==5)
{
DTYmap[l+1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l+1][m]==4||DTYmap[l+1][m]==7||DTYmap[l+1][m]==5)
{
if(DTYmap[l+2][m]==0||DTYmap[l+2][m]==3)
{
DTYmap[l+2][m]+=4;
DTYmap[l+1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 75:
if(DTYmap[l][m-1]==0||DTYmap[l][m-1]==3||DTYmap[l][m-1]==5)
{
DTYmap[l][m-1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m-1]==4||DTYmap[l][m-1]==7||DTYmap[l][m-1]==5)
{
if(DTYmap[l][m-2]==0||DTYmap[l][m-2]==3)
{
DTYmap[l][m-2]+=4;
DTYmap[l][m-1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 77:
if(DTYmap[l][m+1]==0||DTYmap[l][m+1]==3||DTYmap[l][m+1]==5)
{
DTYmap[l][m+1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m+1]==4||DTYmap[l][m+1]==7||DTYmap[l][m+1]==5)
{
if(DTYmap[l][m+2]==0||DTYmap[l][m+2]==3)
{
DTYmap[l][m+2]+=4;
DTYmap[l][m+1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
else if(g==5)
{
//2人导弹模式(无坐标)
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWJmap[i][j]==5||DWJmap[i][j]==8||DWJmap[i][j]==11)
{
r=i;
c=j;
}
if(DWJmap[i][j]==6||DWJmap[i][j]==9||DWJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWJmap[r][c]==DWJmap[x][y]) z1=0;
if(DWJmap[l][m]==DWJmap[x][y]) z2=0;
if(z1==0)
{
DWJmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWJmap[l][m]-=6;
z1+=2;
}
switch(ch)
{
case 'W':
case 'w':
if((DWJmap[r-1][c]==0||DWJmap[r-1][c]==3||DWJmap[r-1][c]==6)&&(z1==1))
{
DWJmap[r-1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r-1][c]==4||DWJmap[r-1][c]==7||DWJmap[r-1][c]==6)&&(z1==1))
{
if((DWJmap[r-2][c]==0||DWJmap[r-2][c]==3)&&(z1==1))
{
DWJmap[r-2][c]+=4;
DWJmap[r-1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWJmap[r+1][c]==0||DWJmap[r+1][c]==3||DWJmap[r+1][c]==6)&&(z1==1))
{
DWJmap[r+1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r+1][c]==4||DWJmap[r+1][c]==7||DWJmap[r+1][c]==6)&&(z1==1))
{
if(DWJmap[r+2][c]==0||DWJmap[r+2][c]==3)
{
DWJmap[r+2][c]+=4;
DWJmap[r+1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWJmap[r][c-1]==0||DWJmap[r][c-1]==3||DWJmap[r][c-1]==6)&&(z1==1))
{
DWJmap[r][c-1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c-1]==4||DWJmap[r][c-1]==7||DWJmap[r][c-1]==6)&&(z1==1))
{
if(DWJmap[r][c-2]==0||DWJmap[r][c-2]==3)
{
DWJmap[r][c-2]+=4;
DWJmap[r][c-1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWJmap[r][c+1]==0||DWJmap[r][c+1]==3||DWJmap[r][c+1]==6)&&(z1==1))
{
DWJmap[r][c+1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c+1]==4||DWJmap[r][c+1]==7||DWJmap[r][c+1]==6)&&(z1==1))
{
if(DWJmap[r][c+2]==0||DWJmap[r][c+2]==3)
{
DWJmap[r][c+2]+=4;
DWJmap[r][c+1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 72:
if((DWJmap[l-1][m]==0||DWJmap[l-1][m]==3||DWJmap[l-1][m]==5)&&(z2==1))
{
DWJmap[l-1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l-1][m]==4||DWJmap[l-1][m]==7||DWJmap[l-1][m]==5)&&(z2==1))
{
if(DWJmap[l-2][m]==0||DWJmap[l-2][m]==3)
{
DWJmap[l-2][m]+=4;
DWJmap[l-1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 80:
if((DWJmap[l+1][m]==0||DWJmap[l+1][m]==3||DWJmap[l+1][m]==5)&&(z2==1))
{
DWJmap[l+1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l+1][m]==4||DWJmap[l+1][m]==7||DWJmap[l+1][m]==5)&&(z2==1))
{
if(DWJmap[l+2][m]==0||DWJmap[l+2][m]==3)
{
DWJmap[l+2][m]+=4;
DWJmap[l+1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 75:
if((DWJmap[l][m-1]==0||DWJmap[l][m-1]==3||DWJmap[l][m-1]==5)&&(z2==1))
{
DWJmap[l][m-1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m-1]==4||DWJmap[l][m-1]==7||DWJmap[l][m-1]==5)&&(z2==1))
{
if(DWJmap[l][m-2]==0||DWJmap[l][m-2]==3)
{
DWJmap[l][m-2]+=4;
DWJmap[l][m-1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 77:
if((DWJmap[l][m+1]==0||DWJmap[l][m+1]==3||DWJmap[l][m+1]==5)&&(z2==1))
{
DWJmap[l][m+1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m+1]==4||DWJmap[l][m+1]==7||DWJmap[l][m+1]==5)&&(z2==1))
{
if(DWJmap[l][m+2]==0||DWJmap[l][m+2]==3)
{
DWJmap[l][m+2]+=4;
DWJmap[l][m+1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWPmap[i][j]==5||DWPmap[i][j]==8||DWPmap[i][j]==11)
{
r=i;
c=j;
}
if(DWPmap[i][j]==6||DWPmap[i][j]==9||DWPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWPmap[r][c]==DWPmap[x][y]) z1=0;
if(DWPmap[l][m]==DWPmap[x][y]) z2=0;
if(z1==0)
{
DWPmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWPmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWPmap[r-1][c]==0||DWPmap[r-1][c]==3||DWPmap[r-1][c]==6)&&(z1==1))
{
DWPmap[r-1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r-1][c]==4||DWPmap[r-1][c]==7||DWPmap[r-1][c]==6)&&(z1==1))
{
if((DWPmap[r-2][c]==0||DWPmap[r-2][c]==3)&&(z1==1))
{
DWPmap[r-2][c]+=4;
DWPmap[r-1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWPmap[r+1][c]==0||DWPmap[r+1][c]==3||DWPmap[r+1][c]==6)&&(z1==1))
{
DWPmap[r+1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r+1][c]==4||DWPmap[r+1][c]==7||DWPmap[r+1][c]==6)&&(z1==1))
{
if(DWPmap[r+2][c]==0||DWPmap[r+2][c]==3)
{
DWPmap[r+2][c]+=4;
DWPmap[r+1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWPmap[r][c-1]==0||DWPmap[r][c-1]==3||DWPmap[r][c-1]==6)&&(z1==1))
{
DWPmap[r][c-1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c-1]==4||DWPmap[r][c-1]==7||DWPmap[r][c-1]==6)&&(z1==1))
{
if(DWPmap[r][c-2]==0||DWPmap[r][c-2]==3)
{
DWPmap[r][c-2]+=4;
DWPmap[r][c-1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWPmap[r][c+1]==0||DWPmap[r][c+1]==3||DWPmap[r][c+1]==6)&&(z1==1))
{
DWPmap[r][c+1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c+1]==4||DWPmap[r][c+1]==7||DWPmap[r][c+1]==6)&&(z1==1))
{
if(DWPmap[r][c+2]==0||DWPmap[r][c+2]==3)
{
DWPmap[r][c+2]+=4;
DWPmap[r][c+1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 72:
if((DWPmap[l-1][m]==0||DWPmap[l-1][m]==3||DWPmap[l-1][m]==5)&&(z2==1))
{
DWPmap[l-1][m]+=6;
DWPmap[l][m]-=6;
}
else if((DWPmap[l-1][m]==4||DWPmap[l-1][m]==7||DWPmap[l-1][m]==5)&&(z2==1))
{
if(DWPmap[l-2][m]==0||DWPmap[l-2][m]==3)
{
DWPmap[l-2][m]+=4;
DWPmap[l-1][m]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 80:
if((DWPmap[l+1][m]==0||DWPmap[l+1][m]==3||DWPmap[l+1][m]==5)&&(z2==1))
{
DWPmap[l+1][m]+=6;
DWPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((DWPmap[l][m-1]==4||DWPmap[l][m-1]==7||DWPmap[l][m-1]==5)&&(z2==1))
{
if(DWPmap[l][m-2]==0||DWPmap[l][m-2]==3)
{
DWPmap[l][m-2]+=4;
DWPmap[l][m-1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 77:
if((DWPmap[l][m+1]==0||DWPmap[l][m+1]==3||DWPmap[l][m+1]==5)&&(z2==1))
{
DWPmap[l][m+1]+=6;
DWPmap[l][m]-=6;
}
else if(DWPmap[l][m+1]==4||DWPmap[l][m+1]==7||DWPmap[l][m+1]==5)
{
if(DWPmap[l][m+2]==0||DWPmap[l][m+2]==3)
{
DWPmap[l][m+2]+=4;
DWPmap[l][m+1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWKmap[i][j]==5||DWKmap[i][j]==8||DWKmap[i][j]==11)
{
r=i;
c=j;
}
if(DWKmap[i][j]==6||DWKmap[i][j]==9||DWKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWKmap[r][c]==DWKmap[x][y]) z1=0;
if(DWKmap[l][m]==DWKmap[x][y]) z2=0;
if(z1==0)
{
DWKmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWKmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWKmap[r-1][c]==0||DWKmap[r-1][c]==3||DWKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((DWKmap[r-1][c]==4||DWKmap[r-1][c]==7||DWKmap[r-1][c]==6)&&(z1==1))
{
if(DWKmap[r-2][c]==0||DWKmap[r-2][c]==3)
{
DWKmap[r-2][c]+=4;
DWKmap[r-1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWKmap[r+1][c]==0||DWKmap[r+1][c]==3||DWKmap[r+1][c]==6)&&(z1==1))
{
DWKmap[r+1][c]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r+1][c]==4||DWKmap[r+1][c]==7||DWKmap[r+1][c]==6)&&(z1==1))
{
if(DWKmap[r+2][c]==0||DWKmap[r+2][c]==3)
{
DWKmap[r+2][c]+=4;
DWKmap[r+1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWKmap[r][c-1]==0||DWKmap[r][c-1]==3||DWKmap[r][c-1]==6)&&(z1==1))
{
DWKmap[r][c-1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c-1]==4||DWKmap[r][c-1]==7||DWKmap[r][c-1]==6)&&(z1==1))
{
if(DWKmap[r][c-2]==0||DWKmap[r][c-2]==3)
{
DWKmap[r][c-2]+=4;
DWKmap[r][c-1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWKmap[r][c+1]==0||DWKmap[r][c+1]==3||DWKmap[r][c+1]==6)&&(z1==1))
{
DWKmap[r][c+1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c+1]==4||DWKmap[r][c+1]==7||DWKmap[r][c+1]==6)&&(z2==1))
{
if(DWKmap[r][c+2]==0||DWKmap[r][c+2]==3)
{
DWKmap[r][c+2]+=4;
DWKmap[r][c+1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 72:
if((DWKmap[l-1][m]==0||DWKmap[l-1][m]==3||DWKmap[l-1][m]==5)&&(z2==1))
{
DWKmap[l-1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l-1][m]==4||DWKmap[l-1][m]==7||DWKmap[l-1][m]==5)&&(z2==1))
{
if((DWKmap[l-2][m]==0||DWKmap[l-2][m]==3)&&(z2==1))
{
DWKmap[l-2][m]+=4;
DWKmap[l-1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 80:
if((DWKmap[l+1][m]==0||DWKmap[l+1][m]==3||DWKmap[l+1][m]==5)&&(z2==1))
{
DWKmap[l+1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l+1][m]==4||DWKmap[l+1][m]==7||DWKmap[l+1][m]==5)&&(z2==1))
{
if(DWKmap[l+2][m]==0||DWKmap[l+2][m]==3)
{
DWKmap[l+2][m]+=4;
DWKmap[l+1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 75:
if((DWKmap[l][m-1]==0||DWKmap[l][m-1]==3||DWKmap[l][m-1]==5)&&(z2==1))
{
DWKmap[l][m-1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m-1]==4||DWKmap[l][m-1]==7||DWKmap[l][m-1]==5)&&(z2==1))
{
if((DWKmap[l][m-2]==0||DWKmap[l][m-2]==3)&&(z2==1))
{
DWKmap[l][m-2]+=4;
DWKmap[l][m-1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 77:
if((DWKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
DWKmap[l][m+1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m+1]==4||DWKmap[l][m+1]==7||DWKmap[l][m+1]==5)&&(z2==1))
{
if(DWKmap[l][m+2]==0||DWKmap[l][m+2]==3)
{
DWKmap[l][m+2]+=4;
DWKmap[l][m+1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTLmap[i][j]==5||DTLmap[i][j]==8||DTLmap[i][j]==11)
{
r=i;
c=j;
}
if(DTLmap[i][j]==6||DTLmap[i][j]==9||DTLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTLmap[r][c]==DTLmap[x][y]) z1=0;
if(DTLmap[l][m]==DTLmap[x][y]) z2=0;
if(z1==0)
{
DTLmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTLmap[l][m]-=6;
z1+=2;
}
switch(ch)
{
case 'W':
case 'w':
if(DTLmap[r-1][c]==0||DTLmap[r-1][c]==3||DTLmap[r-1][c]==6)
{
DTLmap[r-1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r-1][c]==4||DTLmap[r-1][c]==7||DTLmap[r-1][c]==6)
{
if(DTLmap[r-2][c]==0||DTLmap[r-2][c]==3)
{
DTLmap[r-2][c]+=4;
DTLmap[r-1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTLmap[r+1][c]==0||DTLmap[r+1][c]==3||DTLmap[r+1][c]==6)
{
DTLmap[r+1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r+1][c]==4||DTLmap[r+1][c]==7||DTLmap[r+1][c]==6)
{
if(DTLmap[r+2][c]==0||DTLmap[r+2][c]==3)
{
DTLmap[r+2][c]+=4;
DTLmap[r+1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTLmap[r][c-1]==0||DTLmap[r][c-1]==3||DTLmap[r][c-1]==6)
{
DTLmap[r][c-1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c-1]==4||DTLmap[r][c-1]==7||DTLmap[r][c-1]==6)
{
if(DTLmap[r][c-2]==0||DTLmap[r][c-2]==3)
{
DTLmap[r][c-2]+=4;
DTLmap[r][c-1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTLmap[r][c+1]==0||DTLmap[r][c+1]==3||DTLmap[r][c+1]==6)
{
DTLmap[r][c+1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c+1]==4||DTLmap[r][c+1]==7||DTLmap[r][c+1]==6)
{
if(DTLmap[r][c+2]==0||DTLmap[r][c+2]==3)
{
DTLmap[r][c+2]+=4;
DTLmap[r][c+1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 72:
if(DTLmap[l-1][m]==0||DTLmap[l-1][m]==3||DTLmap[l-1][m]==5)
{
DTLmap[l-1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l-1][m]==4||DTLmap[l-1][m]==7||DTLmap[l-1][m]==5)
{
if(DTLmap[l-2][m]==0||DTLmap[l-2][m]==3)
{
DTLmap[l-2][m]+=4;
DTLmap[l-1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 80:
if(DTLmap[l+1][m]==0||DTLmap[l+1][m]==3||DTLmap[l+1][m]==5)
{
DTLmap[l+1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l+1][m]==4||DTLmap[l+1][m]==7||DTLmap[l+1][m]==5)
{
if(DTLmap[l+2][m]==0||DTLmap[l+2][m]==3)
{
DTLmap[l+2][m]+=4;
DTLmap[l+1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 75:
if(DTLmap[l][m-1]==0||DTLmap[l][m-1]==3||DTLmap[l][m-1]==5)
{
DTLmap[l][m-1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m-1]==4||DTLmap[l][m-1]==7||DTLmap[l][m-1]==5)
{
if(DTLmap[l][m-2]==0||DTLmap[l][m-2]==3)
{
DTLmap[l][m-2]+=4;
DTLmap[l][m-1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 77:
if(DTLmap[l][m+1]==0||DTLmap[l][m+1]==3||DTLmap[l][m+1]==5)
{
DTLmap[l][m+1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m+1]==4||DTLmap[l][m+1]==7||DTLmap[l][m+1]==5)
{
if(DTLmap[l][m+2]==0||DTLmap[l][m+2]==3)
{
DTLmap[l][m+2]+=4;
DTLmap[l][m+1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTSmap[i][j]==5||DTSmap[i][j]==8||DTSmap[i][j]==11)
{
r=i;
c=j;
}
if(DTSmap[i][j]==6||DTSmap[i][j]==9||DTSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTSmap[r][c]==DTSmap[x][y]) z1=0;
if(DTSmap[l][m]==DTSmap[x][y]) z2=0;
if(z1==0)
{
DTSmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTSmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTSmap[r-1][c]==0||DTSmap[r-1][c]==3||DTSmap[r-1][c]==6)
{
DTSmap[r-1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r-1][c]==4||DTSmap[r-1][c]==7||DTSmap[r-1][c]==6)
{
if(DTSmap[r-2][c]==0||DTSmap[r-2][c]==3)
{
DTSmap[r-2][c]+=4;
DTSmap[r-1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTSmap[r+1][c]==0||DTSmap[r+1][c]==3||DTSmap[r+1][c]==6)
{
DTSmap[r+1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r+1][c]==4||DTSmap[r+1][c]==7||DTSmap[r+1][c]==6)
{
if(DTSmap[r+2][c]==0||DTSmap[r+2][c]==3)
{
DTSmap[r+2][c]+=4;
DTSmap[r+1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTSmap[r][c-1]==0||DTSmap[r][c-1]==3||DTSmap[r][c-1]==6)
{
DTSmap[r][c-1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c-1]==4||DTSmap[r][c-1]==7||DTSmap[r][c-1]==6)
{
if(DTSmap[r][c-2]==0||DTSmap[r][c-2]==3)
{
DTSmap[r][c-2]+=4;
DTSmap[r][c-1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTSmap[r][c+1]==0||DTSmap[r][c+1]==3||DTSmap[r][c+1]==6)
{
DTSmap[r][c+1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c+1]==4||DTSmap[r][c+1]==7||DTSmap[r][c+1]==6)
{
if(DTSmap[r][c+2]==0||DTSmap[r][c+2]==3)
{
DTSmap[r][c+2]+=4;
DTSmap[r][c+1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 72:
if(DTSmap[l-1][m]==0||DTSmap[l-1][m]==3||DTSmap[l-1][m]==5)
{
DTSmap[l-1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l-1][m]==4||DTSmap[l-1][m]==7||DTSmap[l-1][m]==5)
{
if(DTSmap[l-2][m]==0||DTSmap[l-2][m]==3)
{
DTSmap[l-2][m]+=4;
DTSmap[l-1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 80:
if(DTSmap[l+1][m]==0||DTSmap[l+1][m]==3||DTSmap[l+1][m]==5)
{
DTSmap[l+1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l+1][m]==4||DTSmap[l+1][m]==7||DTSmap[l+1][m]==5)
{
if(DTSmap[l+2][m]==0||DTSmap[l+2][m]==3)
{
DTSmap[l+2][m]+=4;
DTSmap[l+1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 75:
if(DTSmap[l][m-1]==0||DTSmap[l][m-1]==3||DTSmap[l][m-1]==5)
{
DTSmap[l][m-1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m-1]==4||DTSmap[l][m-1]==7||DTSmap[l][m-1]==5)
{
if(DTSmap[l][m-2]==0||DTSmap[l][m-2]==3)
{
DTSmap[l][m-2]+=4;
DTSmap[l][m-1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 77:
if(DTSmap[l][m+1]==0||DTSmap[l][m+1]==3||DTSmap[l][m+1]==5)
{
DTSmap[l][m+1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m+1]==4||DTSmap[l][m+1]==7||DTSmap[l][m+1]==5)
{
if(DTSmap[l][m+2]==0||DTSmap[l][m+2]==3)
{
DTSmap[l][m+2]+=4;
DTSmap[l][m+1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTYmap[i][j]==5||DTYmap[i][j]==8||DTYmap[i][j]==11)
{
r=i;
c=j;
}
if(DTYmap[i][j]==6||DTYmap[i][j]==9||DTYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTYmap[r][c]==DTYmap[x][y]) z1=0;
if(DTYmap[l][m]==DTYmap[x][y]) z2=0;
if(z1==0)
{
DTYmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTYmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTYmap[r-1][c]==0||DTYmap[r-1][c]==3||DTYmap[r-1][c]==6)
{
DTYmap[r-1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r-1][c]==4||DTYmap[r-1][c]==7||DTYmap[r-1][c]==6)
{
if(DTYmap[r-2][c]==0||DTYmap[r-2][c]==3)
{
DTYmap[r-2][c]+=4;
DTYmap[r-1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTYmap[r+1][c]==0||DTYmap[r+1][c]==3||DTYmap[r+1][c]==6)
{
DTYmap[r+1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r+1][c]==4||DTYmap[r+1][c]==7||DTYmap[r+1][c]==6)
{
if(DTYmap[r+2][c]==0||DTYmap[r+2][c]==3)
{
DTYmap[r+2][c]+=4;
DTYmap[r+1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTYmap[r][c-1]==0||DTYmap[r][c-1]==3||DTYmap[r][c-1]==6)
{
DTYmap[r][c-1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c-1]==4||DTYmap[r][c-1]==7||DTYmap[r][c-1]==6)
{
if(DTYmap[r][c-2]==0||DTYmap[r][c-2]==3)
{
DTYmap[r][c-2]+=4;
DTYmap[r][c-1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTYmap[r][c+1]==0||DTYmap[r][c+1]==3||DTYmap[r][c+1]==6)
{
DTYmap[r][c+1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c+1]==4||DTYmap[r][c+1]==7||DTYmap[r][c+1]==6)
{
if(DTYmap[r][c+2]==0||DTYmap[r][c+2]==3)
{
DTYmap[r][c+2]+=4;
DTYmap[r][c+1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 72:
if(DTYmap[l-1][m]==0||DTYmap[l-1][m]==3||DTYmap[l-1][m]==5)
{
DTYmap[l-1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l-1][m]==4||DTYmap[l-1][m]==7||DTYmap[l-1][m]==5)
{
if(DTYmap[l-2][m]==0||DTYmap[l-2][m]==3)
{
DTYmap[l-2][m]+=4;
DTYmap[l-1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 80:
if(DTYmap[l+1][m]==0||DTYmap[l+1][m]==3||DTYmap[l+1][m]==5)
{
DTYmap[l+1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l+1][m]==4||DTYmap[l+1][m]==7||DTYmap[l+1][m]==5)
{
if(DTYmap[l+2][m]==0||DTYmap[l+2][m]==3)
{
DTYmap[l+2][m]+=4;
DTYmap[l+1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 75:
if(DTYmap[l][m-1]==0||DTYmap[l][m-1]==3||DTYmap[l][m-1]==5)
{
DTYmap[l][m-1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m-1]==4||DTYmap[l][m-1]==7||DTYmap[l][m-1]==5)
{
if(DTYmap[l][m-2]==0||DTYmap[l][m-2]==3)
{
DTYmap[l][m-2]+=4;
DTYmap[l][m-1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 77:
if(DTYmap[l][m+1]==0||DTYmap[l][m+1]==3||DTYmap[l][m+1]==5)
{
DTYmap[l][m+1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m+1]==4||DTYmap[l][m+1]==7||DTYmap[l][m+1]==5)
{
if(DTYmap[l][m+2]==0||DTYmap[l][m+2]==3)
{
DTYmap[l][m+2]+=4;
DTYmap[l][m+1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
else if(g==6)
{
//1人导弹模式(无坐标)
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WJmap[i][j]==5||WJmap[i][j]==8||WJmap[i][j]==11)
{
r=i;
c=j;
}
if(WJmap[i][j]==6||WJmap[i][j]==9||WJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WJmap[r][c]==WJmap[x][y]) z1=0;
if(z1==0)
{
WJmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WJmap[r-1][c]==0||WJmap[r-1][c]==3||WJmap[r-1][c]==6)&&(z1==1))
{
WJmap[r-1][c]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r-1][c]==4||WJmap[r-1][c]==7||WJmap[r-1][c]==6)&&(z1==1))
{
if((WJmap[r-2][c]==0||WJmap[r-2][c]==3)&&(z1==1))
{
WJmap[r-2][c]+=4;
WJmap[r-1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WJmap[r+1][c]==0||WJmap[r+1][c]==3||WJmap[r+1][c]==6)&&(z1==1))
{
WJmap[r+1][c]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r+1][c]==4||WJmap[r+1][c]==7||WJmap[r+1][c]==6)&&(z1==1))
{
if(WJmap[r+2][c]==0||WJmap[r+2][c]==3)
{
WJmap[r+2][c]+=4;
WJmap[r+1][c]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WJmap[r][c-1]==0||WJmap[r][c-1]==3||WJmap[r][c-1]==6)&&(z1==1))
{
WJmap[r][c-1]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r][c-1]==4||WJmap[r][c-1]==7||WJmap[r][c-1]==6)&&(z1==1))
{
if(WJmap[r][c-2]==0||WJmap[r][c-2]==3)
{
WJmap[r][c-2]+=4;
WJmap[r][c-1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WJmap[r][c+1]==0||WJmap[r][c+1]==3||WJmap[r][c+1]==6)&&(z1==1))
{
WJmap[r][c+1]+=5;
WJmap[r][c]-=5;
}
else if((WJmap[r][c+1]==4||WJmap[r][c+1]==7||WJmap[r][c+1]==6)&&(z1==1))
{
if(WJmap[r][c+2]==0||WJmap[r][c+2]==3)
{
WJmap[r][c+2]+=4;
WJmap[r][c+1]+=1;
WJmap[r][c]-=5;
}
}
break;
case 72:
if((WJmap[l-1][m]==0||WJmap[l-1][m]==3||WJmap[l-1][m]==5)&&(z2==1))
{
WJmap[l-1][m]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l-1][m]==4||WJmap[l-1][m]==7||WJmap[l-1][m]==5)&&(z2==1))
{
if(WJmap[l-2][m]==0||WJmap[l-2][m]==3)
{
WJmap[l-2][m]+=4;
WJmap[l-1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 80:
if((WJmap[l+1][m]==0||WJmap[l+1][m]==3||WJmap[l+1][m]==5)&&(z2==1))
{
WJmap[l+1][m]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l+1][m]==4||WJmap[l+1][m]==7||WJmap[l+1][m]==5)&&(z2==1))
{
if(WJmap[l+2][m]==0||WJmap[l+2][m]==3)
{
WJmap[l+2][m]+=4;
WJmap[l+1][m]+=2;
WJmap[l][m]-=6;
}
}
break;
case 75:
if((WJmap[l][m-1]==0||WJmap[l][m-1]==3||WJmap[l][m-1]==5)&&(z2==1))
{
WJmap[l][m-1]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l][m-1]==4||WJmap[l][m-1]==7||WJmap[l][m-1]==5)&&(z2==1))
{
if(WJmap[l][m-2]==0||WJmap[l][m-2]==3)
{
WJmap[l][m-2]+=4;
WJmap[l][m-1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 77:
if((WJmap[l][m+1]==0||WJmap[l][m+1]==3||WJmap[l][m+1]==5)&&(z2==1))
{
WJmap[l][m+1]+=6;
WJmap[l][m]-=6;
}
else if((WJmap[l][m+1]==4||WJmap[l][m+1]==7||WJmap[l][m+1]==5)&&(z2==1))
{
if(WJmap[l][m+2]==0||WJmap[l][m+2]==3)
{
WJmap[l][m+2]+=4;
WJmap[l][m+1]+=2;
WJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WPmap[i][j]==5||WPmap[i][j]==8||WPmap[i][j]==11)
{
r=i;
c=j;
}
if(WPmap[i][j]==6||WPmap[i][j]==9||WPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WPmap[r][c]==WPmap[x][y]) z1=0;
if(z1==0)
{
WPmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WPmap[r-1][c]==0||WPmap[r-1][c]==3||WPmap[r-1][c]==6)&&(z1==1))
{
WPmap[r-1][c]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r-1][c]==4||WPmap[r-1][c]==7||WPmap[r-1][c]==6)&&(z1==1))
{
if((WPmap[r-2][c]==0||WPmap[r-2][c]==3)&&(z1==1))
{
WPmap[r-2][c]+=4;
WPmap[r-1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WPmap[r+1][c]==0||WPmap[r+1][c]==3||WPmap[r+1][c]==6)&&(z1==1))
{
WPmap[r+1][c]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r+1][c]==4||WPmap[r+1][c]==7||WPmap[r+1][c]==6)&&(z1==1))
{
if(WPmap[r+2][c]==0||WPmap[r+2][c]==3)
{
WPmap[r+2][c]+=4;
WPmap[r+1][c]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WPmap[r][c-1]==0||WPmap[r][c-1]==3||WPmap[r][c-1]==6)&&(z1==1))
{
WPmap[r][c-1]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r][c-1]==4||WPmap[r][c-1]==7||WPmap[r][c-1]==6)&&(z1==1))
{
if(WPmap[r][c-2]==0||WPmap[r][c-2]==3)
{
WPmap[r][c-2]+=4;
WPmap[r][c-1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WPmap[r][c+1]==0||WPmap[r][c+1]==3||WPmap[r][c+1]==6)&&(z1==1))
{
WPmap[r][c+1]+=5;
WPmap[r][c]-=5;
}
else if((WPmap[r][c+1]==4||WPmap[r][c+1]==7||WPmap[r][c+1]==6)&&(z1==1))
{
if(WPmap[r][c+2]==0||WPmap[r][c+2]==3)
{
WPmap[r][c+2]+=4;
WPmap[r][c+1]+=1;
WPmap[r][c]-=5;
}
}
break;
case 72:
if((WPmap[l-1][m]==0||WPmap[l-1][m]==3||WPmap[l-1][m]==5)&&(z2==1))
{
WPmap[l-1][m]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l-1][m]==4||WPmap[l-1][m]==7||WPmap[l-1][m]==5)&&(z2==1))
{
if(WPmap[l-2][m]==0||WPmap[l-2][m]==3)
{
WPmap[l-2][m]+=4;
WPmap[l-1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 80:
if((WPmap[l+1][m]==0||WPmap[l+1][m]==3||WPmap[l+1][m]==5)&&(z2==1))
{
WPmap[l+1][m]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((WPmap[l][m-1]==4||WPmap[l][m-1]==7||WPmap[l][m-1]==5)&&(z2==1))
{
if(WPmap[l][m-2]==0||WPmap[l][m-2]==3)
{
WPmap[l][m-2]+=4;
WPmap[l][m-1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 77:
if((WPmap[l][m+1]==0||WPmap[l][m+1]==3||WPmap[l][m+1]==5)&&(z2==1))
{
WPmap[l][m+1]+=6;
WPmap[l][m]-=6;
}
else if(WPmap[l][m+1]==4||WPmap[l][m+1]==7||WPmap[l][m+1]==5)
{
if(WPmap[l][m+2]==0||WPmap[l][m+2]==3)
{
WPmap[l][m+2]+=4;
WPmap[l][m+1]+=2;
WPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(WKmap[i][j]==5||WKmap[i][j]==8||WKmap[i][j]==11)
{
r=i;
c=j;
}
if(WKmap[i][j]==6||WKmap[i][j]==9||WKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(WKmap[r][c]==WKmap[x][y]) z1=0;
if(z1==0)
{
WKmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if((WKmap[r-1][c]==0||WKmap[r-1][c]==3||WKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r-1][c]==4||WKmap[r-1][c]==7||WKmap[r-1][c]==6)&&(z1==1))
{
if(WKmap[r-2][c]==0||WKmap[r-2][c]==3)
{
WKmap[r-2][c]+=4;
WKmap[r-1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((WKmap[r+1][c]==0||WKmap[r+1][c]==3||WKmap[r+1][c]==6)&&(z1==1))
{
WKmap[r+1][c]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r+1][c]==4||WKmap[r+1][c]==7||WKmap[r+1][c]==6)&&(z1==1))
{
if(WKmap[r+2][c]==0||WKmap[r+2][c]==3)
{
WKmap[r+2][c]+=4;
WKmap[r+1][c]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((WKmap[r][c-1]==0||WKmap[r][c-1]==3||WKmap[r][c-1]==6)&&(z1==1))
{
WKmap[r][c-1]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r][c-1]==4||WKmap[r][c-1]==7||WKmap[r][c-1]==6)&&(z1==1))
{
if(WKmap[r][c-2]==0||WKmap[r][c-2]==3)
{
WKmap[r][c-2]+=4;
WKmap[r][c-1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((WKmap[r][c+1]==0||WKmap[r][c+1]==3||WKmap[r][c+1]==6)&&(z1==1))
{
WKmap[r][c+1]+=5;
WKmap[r][c]-=5;
}
else if((WKmap[r][c+1]==4||WKmap[r][c+1]==7||WKmap[r][c+1]==6)&&(z2==1))
{
if(WKmap[r][c+2]==0||WKmap[r][c+2]==3)
{
WKmap[r][c+2]+=4;
WKmap[r][c+1]+=1;
WKmap[r][c]-=5;
}
}
break;
case 72:
if((WKmap[l-1][m]==0||WKmap[l-1][m]==3||WKmap[l-1][m]==5)&&(z2==1))
{
WKmap[l-1][m]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l-1][m]==4||WKmap[l-1][m]==7||WKmap[l-1][m]==5)&&(z2==1))
{
if((WKmap[l-2][m]==0||WKmap[l-2][m]==3)&&(z2==1))
{
WKmap[l-2][m]+=4;
WKmap[l-1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 80:
if((WKmap[l+1][m]==0||WKmap[l+1][m]==3||WKmap[l+1][m]==5)&&(z2==1))
{
WKmap[l+1][m]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l+1][m]==4||WKmap[l+1][m]==7||WKmap[l+1][m]==5)&&(z2==1))
{
if(WKmap[l+2][m]==0||WKmap[l+2][m]==3)
{
WKmap[l+2][m]+=4;
WKmap[l+1][m]+=2;
WKmap[l][m]-=6;
}
}
break;
case 75:
if((WKmap[l][m-1]==0||WKmap[l][m-1]==3||WKmap[l][m-1]==5)&&(z2==1))
{
WKmap[l][m-1]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l][m-1]==4||WKmap[l][m-1]==7||WKmap[l][m-1]==5)&&(z2==1))
{
if((WKmap[l][m-2]==0||WKmap[l][m-2]==3)&&(z2==1))
{
WKmap[l][m-2]+=4;
WKmap[l][m-1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 77:
if((WKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
WKmap[l][m+1]+=6;
WKmap[l][m]-=6;
}
else if((WKmap[l][m+1]==4||WKmap[l][m+1]==7||WKmap[l][m+1]==5)&&(z2==1))
{
if(WKmap[l][m+2]==0||WKmap[l][m+2]==3)
{
WKmap[l][m+2]+=4;
WKmap[l][m+1]+=2;
WKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TLmap[i][j]==5||TLmap[i][j]==8||TLmap[i][j]==11)
{
r=i;
c=j;
}
if(TLmap[i][j]==6||TLmap[i][j]==9||TLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TLmap[r][c]==TLmap[x][y]) z1=0;
if(z1==0)
{
TLmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TLmap[r-1][c]==0||TLmap[r-1][c]==3||TLmap[r-1][c]==6)
{
TLmap[r-1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r-1][c]==4||TLmap[r-1][c]==7||TLmap[r-1][c]==6)
{
if(TLmap[r-2][c]==0||TLmap[r-2][c]==3)
{
TLmap[r-2][c]+=4;
TLmap[r-1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TLmap[r+1][c]==0||TLmap[r+1][c]==3||TLmap[r+1][c]==6)
{
TLmap[r+1][c]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r+1][c]==4||TLmap[r+1][c]==7||TLmap[r+1][c]==6)
{
if(TLmap[r+2][c]==0||TLmap[r+2][c]==3)
{
TLmap[r+2][c]+=4;
TLmap[r+1][c]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TLmap[r][c-1]==0||TLmap[r][c-1]==3||TLmap[r][c-1]==6)
{
TLmap[r][c-1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c-1]==4||TLmap[r][c-1]==7||TLmap[r][c-1]==6)
{
if(TLmap[r][c-2]==0||TLmap[r][c-2]==3)
{
TLmap[r][c-2]+=4;
TLmap[r][c-1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TLmap[r][c+1]==0||TLmap[r][c+1]==3||TLmap[r][c+1]==6)
{
TLmap[r][c+1]+=5;
TLmap[r][c]-=5;
}
else if(TLmap[r][c+1]==4||TLmap[r][c+1]==7||TLmap[r][c+1]==6)
{
if(TLmap[r][c+2]==0||TLmap[r][c+2]==3)
{
TLmap[r][c+2]+=4;
TLmap[r][c+1]+=1;
TLmap[r][c]-=5;
}
}
break;
case 72:
if(TLmap[l-1][m]==0||TLmap[l-1][m]==3||TLmap[l-1][m]==5)
{
TLmap[l-1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l-1][m]==4||TLmap[l-1][m]==7||TLmap[l-1][m]==5)
{
if(TLmap[l-2][m]==0||TLmap[l-2][m]==3)
{
TLmap[l-2][m]+=4;
TLmap[l-1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 80:
if(TLmap[l+1][m]==0||TLmap[l+1][m]==3||TLmap[l+1][m]==5)
{
TLmap[l+1][m]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l+1][m]==4||TLmap[l+1][m]==7||TLmap[l+1][m]==5)
{
if(TLmap[l+2][m]==0||TLmap[l+2][m]==3)
{
TLmap[l+2][m]+=4;
TLmap[l+1][m]+=2;
TLmap[l][m]-=6;
}
}
break;
case 75:
if(TLmap[l][m-1]==0||TLmap[l][m-1]==3||TLmap[l][m-1]==5)
{
TLmap[l][m-1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m-1]==4||TLmap[l][m-1]==7||TLmap[l][m-1]==5)
{
if(TLmap[l][m-2]==0||TLmap[l][m-2]==3)
{
TLmap[l][m-2]+=4;
TLmap[l][m-1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 77:
if(TLmap[l][m+1]==0||TLmap[l][m+1]==3||TLmap[l][m+1]==5)
{
TLmap[l][m+1]+=6;
TLmap[l][m]-=6;
}
else if(TLmap[l][m+1]==4||TLmap[l][m+1]==7||TLmap[l][m+1]==5)
{
if(TLmap[l][m+2]==0||TLmap[l][m+2]==3)
{
TLmap[l][m+2]+=4;
TLmap[l][m+1]+=2;
TLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TSmap[i][j]==5||TSmap[i][j]==8||TSmap[i][j]==11)
{
r=i;
c=j;
}
if(TSmap[i][j]==6||TSmap[i][j]==9||TSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TSmap[r][c]==TSmap[x][y]) z1=0;
if(z1==0)
{
TSmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TSmap[r-1][c]==0||TSmap[r-1][c]==3||TSmap[r-1][c]==6)
{
TSmap[r-1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r-1][c]==4||TSmap[r-1][c]==7||TSmap[r-1][c]==6)
{
if(TSmap[r-2][c]==0||TSmap[r-2][c]==3)
{
TSmap[r-2][c]+=4;
TSmap[r-1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TSmap[r+1][c]==0||TSmap[r+1][c]==3||TSmap[r+1][c]==6)
{
TSmap[r+1][c]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r+1][c]==4||TSmap[r+1][c]==7||TSmap[r+1][c]==6)
{
if(TSmap[r+2][c]==0||TSmap[r+2][c]==3)
{
TSmap[r+2][c]+=4;
TSmap[r+1][c]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TSmap[r][c-1]==0||TSmap[r][c-1]==3||TSmap[r][c-1]==6)
{
TSmap[r][c-1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c-1]==4||TSmap[r][c-1]==7||TSmap[r][c-1]==6)
{
if(TSmap[r][c-2]==0||TSmap[r][c-2]==3)
{
TSmap[r][c-2]+=4;
TSmap[r][c-1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TSmap[r][c+1]==0||TSmap[r][c+1]==3||TSmap[r][c+1]==6)
{
TSmap[r][c+1]+=5;
TSmap[r][c]-=5;
}
else if(TSmap[r][c+1]==4||TSmap[r][c+1]==7||TSmap[r][c+1]==6)
{
if(TSmap[r][c+2]==0||TSmap[r][c+2]==3)
{
TSmap[r][c+2]+=4;
TSmap[r][c+1]+=1;
TSmap[r][c]-=5;
}
}
break;
case 72:
if(TSmap[l-1][m]==0||TSmap[l-1][m]==3||TSmap[l-1][m]==5)
{
TSmap[l-1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l-1][m]==4||TSmap[l-1][m]==7||TSmap[l-1][m]==5)
{
if(TSmap[l-2][m]==0||TSmap[l-2][m]==3)
{
TSmap[l-2][m]+=4;
TSmap[l-1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 80:
if(TSmap[l+1][m]==0||TSmap[l+1][m]==3||TSmap[l+1][m]==5)
{
TSmap[l+1][m]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l+1][m]==4||TSmap[l+1][m]==7||TSmap[l+1][m]==5)
{
if(TSmap[l+2][m]==0||TSmap[l+2][m]==3)
{
TSmap[l+2][m]+=4;
TSmap[l+1][m]+=2;
TSmap[l][m]-=6;
}
}
break;
case 75:
if(TSmap[l][m-1]==0||TSmap[l][m-1]==3||TSmap[l][m-1]==5)
{
TSmap[l][m-1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m-1]==4||TSmap[l][m-1]==7||TSmap[l][m-1]==5)
{
if(TSmap[l][m-2]==0||TSmap[l][m-2]==3)
{
TSmap[l][m-2]+=4;
TSmap[l][m-1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 77:
if(TSmap[l][m+1]==0||TSmap[l][m+1]==3||TSmap[l][m+1]==5)
{
TSmap[l][m+1]+=6;
TSmap[l][m]-=6;
}
else if(TSmap[l][m+1]==4||TSmap[l][m+1]==7||TSmap[l][m+1]==5)
{
if(TSmap[l][m+2]==0||TSmap[l][m+2]==3)
{
TSmap[l][m+2]+=4;
TSmap[l][m+1]+=2;
TSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(TYmap[i][j]==5||TYmap[i][j]==8||TYmap[i][j]==11)
{
r=i;
c=j;
}
if(TYmap[i][j]==6||TYmap[i][j]==9||TYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(TYmap[r][c]==TYmap[x][y]) z1=0;
if(z1==0)
{
TYmap[r][c]-=5;
z1+=2;
}
if(z1==0)
{
cout<<"1被炸死了!"<<endl;
flag=false;
}
switch(ch)
{
case 'W':
case 'w':
if(TYmap[r-1][c]==0||TYmap[r-1][c]==3||TYmap[r-1][c]==6)
{
TYmap[r-1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r-1][c]==4||TYmap[r-1][c]==7||TYmap[r-1][c]==6)
{
if(TYmap[r-2][c]==0||TYmap[r-2][c]==3)
{
TYmap[r-2][c]+=4;
TYmap[r-1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(TYmap[r+1][c]==0||TYmap[r+1][c]==3||TYmap[r+1][c]==6)
{
TYmap[r+1][c]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r+1][c]==4||TYmap[r+1][c]==7||TYmap[r+1][c]==6)
{
if(TYmap[r+2][c]==0||TYmap[r+2][c]==3)
{
TYmap[r+2][c]+=4;
TYmap[r+1][c]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(TYmap[r][c-1]==0||TYmap[r][c-1]==3||TYmap[r][c-1]==6)
{
TYmap[r][c-1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c-1]==4||TYmap[r][c-1]==7||TYmap[r][c-1]==6)
{
if(TYmap[r][c-2]==0||TYmap[r][c-2]==3)
{
TYmap[r][c-2]+=4;
TYmap[r][c-1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(TYmap[r][c+1]==0||TYmap[r][c+1]==3||TYmap[r][c+1]==6)
{
TYmap[r][c+1]+=5;
TYmap[r][c]-=5;
}
else if(TYmap[r][c+1]==4||TYmap[r][c+1]==7||TYmap[r][c+1]==6)
{
if(TYmap[r][c+2]==0||TYmap[r][c+2]==3)
{
TYmap[r][c+2]+=4;
TYmap[r][c+1]+=1;
TYmap[r][c]-=5;
}
}
break;
case 72:
if(TYmap[l-1][m]==0||TYmap[l-1][m]==3||TYmap[l-1][m]==5)
{
TYmap[l-1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l-1][m]==4||TYmap[l-1][m]==7||TYmap[l-1][m]==5)
{
if(TYmap[l-2][m]==0||TYmap[l-2][m]==3)
{
TYmap[l-2][m]+=4;
TYmap[l-1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 80:
if(TYmap[l+1][m]==0||TYmap[l+1][m]==3||TYmap[l+1][m]==5)
{
TYmap[l+1][m]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l+1][m]==4||TYmap[l+1][m]==7||TYmap[l+1][m]==5)
{
if(TYmap[l+2][m]==0||TYmap[l+2][m]==3)
{
TYmap[l+2][m]+=4;
TYmap[l+1][m]+=2;
TYmap[l][m]-=6;
}
}
break;
case 75:
if(TYmap[l][m-1]==0||TYmap[l][m-1]==3||TYmap[l][m-1]==5)
{
TYmap[l][m-1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m-1]==4||TYmap[l][m-1]==7||TYmap[l][m-1]==5)
{
if(TYmap[l][m-2]==0||TYmap[l][m-2]==3)
{
TYmap[l][m-2]+=4;
TYmap[l][m-1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 77:
if(TYmap[l][m+1]==0||TYmap[l][m+1]==3||TYmap[l][m+1]==5)
{
TYmap[l][m+1]+=6;
TYmap[l][m]-=6;
}
else if(TYmap[l][m+1]==4||TYmap[l][m+1]==7||TYmap[l][m+1]==5)
{
if(TYmap[l][m+2]==0||TYmap[l][m+2]==3)
{
TYmap[l][m+2]+=4;
TYmap[l][m+1]+=2;
TYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
else if(g==7)
{
//2人模式
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWJmap[i][j]==5||DWJmap[i][j]==8||DWJmap[i][j]==11)
{
r=i;
c=j;
}
if(DWJmap[i][j]==6||DWJmap[i][j]==9||DWJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWJmap[r-1][c]==0||DWJmap[r-1][c]==3||DWJmap[r-1][c]==6)&&(z1==1))
{
DWJmap[r-1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r-1][c]==4||DWJmap[r-1][c]==7||DWJmap[r-1][c]==6)&&(z1==1))
{
if((DWJmap[r-2][c]==0||DWJmap[r-2][c]==3)&&(z1==1))
{
DWJmap[r-2][c]+=4;
DWJmap[r-1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWJmap[r+1][c]==0||DWJmap[r+1][c]==3||DWJmap[r+1][c]==6)&&(z1==1))
{
DWJmap[r+1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r+1][c]==4||DWJmap[r+1][c]==7||DWJmap[r+1][c]==6)&&(z1==1))
{
if(DWJmap[r+2][c]==0||DWJmap[r+2][c]==3)
{
DWJmap[r+2][c]+=4;
DWJmap[r+1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWJmap[r][c-1]==0||DWJmap[r][c-1]==3||DWJmap[r][c-1]==6)&&(z1==1))
{
DWJmap[r][c-1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c-1]==4||DWJmap[r][c-1]==7||DWJmap[r][c-1]==6)&&(z1==1))
{
if(DWJmap[r][c-2]==0||DWJmap[r][c-2]==3)
{
DWJmap[r][c-2]+=4;
DWJmap[r][c-1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWJmap[r][c+1]==0||DWJmap[r][c+1]==3||DWJmap[r][c+1]==6)&&(z1==1))
{
DWJmap[r][c+1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c+1]==4||DWJmap[r][c+1]==7||DWJmap[r][c+1]==6)&&(z1==1))
{
if(DWJmap[r][c+2]==0||DWJmap[r][c+2]==3)
{
DWJmap[r][c+2]+=4;
DWJmap[r][c+1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 72:
if((DWJmap[l-1][m]==0||DWJmap[l-1][m]==3||DWJmap[l-1][m]==5)&&(z2==1))
{
DWJmap[l-1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l-1][m]==4||DWJmap[l-1][m]==7||DWJmap[l-1][m]==5)&&(z2==1))
{
if(DWJmap[l-2][m]==0||DWJmap[l-2][m]==3)
{
DWJmap[l-2][m]+=4;
DWJmap[l-1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 80:
if((DWJmap[l+1][m]==0||DWJmap[l+1][m]==3||DWJmap[l+1][m]==5)&&(z2==1))
{
DWJmap[l+1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l+1][m]==4||DWJmap[l+1][m]==7||DWJmap[l+1][m]==5)&&(z2==1))
{
if(DWJmap[l+2][m]==0||DWJmap[l+2][m]==3)
{
DWJmap[l+2][m]+=4;
DWJmap[l+1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 75:
if((DWJmap[l][m-1]==0||DWJmap[l][m-1]==3||DWJmap[l][m-1]==5)&&(z2==1))
{
DWJmap[l][m-1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m-1]==4||DWJmap[l][m-1]==7||DWJmap[l][m-1]==5)&&(z2==1))
{
if(DWJmap[l][m-2]==0||DWJmap[l][m-2]==3)
{
DWJmap[l][m-2]+=4;
DWJmap[l][m-1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 77:
if((DWJmap[l][m+1]==0||DWJmap[l][m+1]==3||DWJmap[l][m+1]==5)&&(z2==1))
{
DWJmap[l][m+1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m+1]==4||DWJmap[l][m+1]==7||DWJmap[l][m+1]==5)&&(z2==1))
{
if(DWJmap[l][m+2]==0||DWJmap[l][m+2]==3)
{
DWJmap[l][m+2]+=4;
DWJmap[l][m+1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWPmap[i][j]==5||DWPmap[i][j]==8||DWPmap[i][j]==11)
{
r=i;
c=j;
}
if(DWPmap[i][j]==6||DWPmap[i][j]==9||DWPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWPmap[r-1][c]==0||DWPmap[r-1][c]==3||DWPmap[r-1][c]==6)&&(z1==1))
{
DWPmap[r-1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r-1][c]==4||DWPmap[r-1][c]==7||DWPmap[r-1][c]==6)&&(z1==1))
{
if((DWPmap[r-2][c]==0||DWPmap[r-2][c]==3)&&(z1==1))
{
DWPmap[r-2][c]+=4;
DWPmap[r-1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWPmap[r+1][c]==0||DWPmap[r+1][c]==3||DWPmap[r+1][c]==6)&&(z1==1))
{
DWPmap[r+1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r+1][c]==4||DWPmap[r+1][c]==7||DWPmap[r+1][c]==6)&&(z1==1))
{
if(DWPmap[r+2][c]==0||DWPmap[r+2][c]==3)
{
DWPmap[r+2][c]+=4;
DWPmap[r+1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWPmap[r][c-1]==0||DWPmap[r][c-1]==3||DWPmap[r][c-1]==6)&&(z1==1))
{
DWPmap[r][c-1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c-1]==4||DWPmap[r][c-1]==7||DWPmap[r][c-1]==6)&&(z1==1))
{
if(DWPmap[r][c-2]==0||DWPmap[r][c-2]==3)
{
DWPmap[r][c-2]+=4;
DWPmap[r][c-1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWPmap[r][c+1]==0||DWPmap[r][c+1]==3||DWPmap[r][c+1]==6)&&(z1==1))
{
DWPmap[r][c+1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c+1]==4||DWPmap[r][c+1]==7||DWPmap[r][c+1]==6)&&(z1==1))
{
if(DWPmap[r][c+2]==0||DWPmap[r][c+2]==3)
{
DWPmap[r][c+2]+=4;
DWPmap[r][c+1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 72:
if((DWPmap[l-1][m]==0||DWPmap[l-1][m]==3||DWPmap[l-1][m]==5)&&(z2==1))
{
DWPmap[l-1][m]+=6;
DWPmap[l][m]-=6;
}
else if((DWPmap[l-1][m]==4||DWPmap[l-1][m]==7||DWPmap[l-1][m]==5)&&(z2==1))
{
if(DWPmap[l-2][m]==0||DWPmap[l-2][m]==3)
{
DWPmap[l-2][m]+=4;
DWPmap[l-1][m]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 80:
if((DWPmap[l+1][m]==0||DWPmap[l+1][m]==3||DWPmap[l+1][m]==5)&&(z2==1))
{
DWPmap[l+1][m]+=6;
DWPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((DWPmap[l][m-1]==4||DWPmap[l][m-1]==7||DWPmap[l][m-1]==5)&&(z2==1))
{
if(DWPmap[l][m-2]==0||DWPmap[l][m-2]==3)
{
DWPmap[l][m-2]+=4;
DWPmap[l][m-1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 77:
if((DWPmap[l][m+1]==0||DWPmap[l][m+1]==3||DWPmap[l][m+1]==5)&&(z2==1))
{
DWPmap[l][m+1]+=6;
DWPmap[l][m]-=6;
}
else if(DWPmap[l][m+1]==4||DWPmap[l][m+1]==7||DWPmap[l][m+1]==5)
{
if(DWPmap[l][m+2]==0||DWPmap[l][m+2]==3)
{
DWPmap[l][m+2]+=4;
DWPmap[l][m+1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWKmap[i][j]==5||DWKmap[i][j]==8||DWKmap[i][j]==11)
{
r=i;
c=j;
}
if(DWKmap[i][j]==6||DWKmap[i][j]==9||DWKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWKmap[r-1][c]==0||DWKmap[r-1][c]==3||DWKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((DWKmap[r-1][c]==4||DWKmap[r-1][c]==7||DWKmap[r-1][c]==6)&&(z1==1))
{
if(DWKmap[r-2][c]==0||DWKmap[r-2][c]==3)
{
DWKmap[r-2][c]+=4;
DWKmap[r-1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWKmap[r+1][c]==0||DWKmap[r+1][c]==3||DWKmap[r+1][c]==6)&&(z1==1))
{
DWKmap[r+1][c]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r+1][c]==4||DWKmap[r+1][c]==7||DWKmap[r+1][c]==6)&&(z1==1))
{
if(DWKmap[r+2][c]==0||DWKmap[r+2][c]==3)
{
DWKmap[r+2][c]+=4;
DWKmap[r+1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWKmap[r][c-1]==0||DWKmap[r][c-1]==3||DWKmap[r][c-1]==6)&&(z1==1))
{
DWKmap[r][c-1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c-1]==4||DWKmap[r][c-1]==7||DWKmap[r][c-1]==6)&&(z1==1))
{
if(DWKmap[r][c-2]==0||DWKmap[r][c-2]==3)
{
DWKmap[r][c-2]+=4;
DWKmap[r][c-1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWKmap[r][c+1]==0||DWKmap[r][c+1]==3||DWKmap[r][c+1]==6)&&(z1==1))
{
DWKmap[r][c+1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c+1]==4||DWKmap[r][c+1]==7||DWKmap[r][c+1]==6)&&(z2==1))
{
if(DWKmap[r][c+2]==0||DWKmap[r][c+2]==3)
{
DWKmap[r][c+2]+=4;
DWKmap[r][c+1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 72:
if((DWKmap[l-1][m]==0||DWKmap[l-1][m]==3||DWKmap[l-1][m]==5)&&(z2==1))
{
DWKmap[l-1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l-1][m]==4||DWKmap[l-1][m]==7||DWKmap[l-1][m]==5)&&(z2==1))
{
if((DWKmap[l-2][m]==0||DWKmap[l-2][m]==3)&&(z2==1))
{
DWKmap[l-2][m]+=4;
DWKmap[l-1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 80:
if((DWKmap[l+1][m]==0||DWKmap[l+1][m]==3||DWKmap[l+1][m]==5)&&(z2==1))
{
DWKmap[l+1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l+1][m]==4||DWKmap[l+1][m]==7||DWKmap[l+1][m]==5)&&(z2==1))
{
if(DWKmap[l+2][m]==0||DWKmap[l+2][m]==3)
{
DWKmap[l+2][m]+=4;
DWKmap[l+1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 75:
if((DWKmap[l][m-1]==0||DWKmap[l][m-1]==3||DWKmap[l][m-1]==5)&&(z2==1))
{
DWKmap[l][m-1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m-1]==4||DWKmap[l][m-1]==7||DWKmap[l][m-1]==5)&&(z2==1))
{
if((DWKmap[l][m-2]==0||DWKmap[l][m-2]==3)&&(z2==1))
{
DWKmap[l][m-2]+=4;
DWKmap[l][m-1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 77:
if((DWKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
DWKmap[l][m+1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m+1]==4||DWKmap[l][m+1]==7||DWKmap[l][m+1]==5)&&(z2==1))
{
if(DWKmap[l][m+2]==0||DWKmap[l][m+2]==3)
{
DWKmap[l][m+2]+=4;
DWKmap[l][m+1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTLmap[i][j]==5||DTLmap[i][j]==8||DTLmap[i][j]==11)
{
r=i;
c=j;
}
if(DTLmap[i][j]==6||DTLmap[i][j]==9||DTLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTLmap[r-1][c]==0||DTLmap[r-1][c]==3||DTLmap[r-1][c]==6)
{
DTLmap[r-1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r-1][c]==4||DTLmap[r-1][c]==7||DTLmap[r-1][c]==6)
{
if(DTLmap[r-2][c]==0||DTLmap[r-2][c]==3)
{
DTLmap[r-2][c]+=4;
DTLmap[r-1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTLmap[r+1][c]==0||DTLmap[r+1][c]==3||DTLmap[r+1][c]==6)
{
DTLmap[r+1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r+1][c]==4||DTLmap[r+1][c]==7||DTLmap[r+1][c]==6)
{
if(DTLmap[r+2][c]==0||DTLmap[r+2][c]==3)
{
DTLmap[r+2][c]+=4;
DTLmap[r+1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTLmap[r][c-1]==0||DTLmap[r][c-1]==3||DTLmap[r][c-1]==6)
{
DTLmap[r][c-1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c-1]==4||DTLmap[r][c-1]==7||DTLmap[r][c-1]==6)
{
if(DTLmap[r][c-2]==0||DTLmap[r][c-2]==3)
{
DTLmap[r][c-2]+=4;
DTLmap[r][c-1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTLmap[r][c+1]==0||DTLmap[r][c+1]==3||DTLmap[r][c+1]==6)
{
DTLmap[r][c+1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c+1]==4||DTLmap[r][c+1]==7||DTLmap[r][c+1]==6)
{
if(DTLmap[r][c+2]==0||DTLmap[r][c+2]==3)
{
DTLmap[r][c+2]+=4;
DTLmap[r][c+1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 72:
if(DTLmap[l-1][m]==0||DTLmap[l-1][m]==3||DTLmap[l-1][m]==5)
{
DTLmap[l-1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l-1][m]==4||DTLmap[l-1][m]==7||DTLmap[l-1][m]==5)
{
if(DTLmap[l-2][m]==0||DTLmap[l-2][m]==3)
{
DTLmap[l-2][m]+=4;
DTLmap[l-1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 80:
if(DTLmap[l+1][m]==0||DTLmap[l+1][m]==3||DTLmap[l+1][m]==5)
{
DTLmap[l+1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l+1][m]==4||DTLmap[l+1][m]==7||DTLmap[l+1][m]==5)
{
if(DTLmap[l+2][m]==0||DTLmap[l+2][m]==3)
{
DTLmap[l+2][m]+=4;
DTLmap[l+1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 75:
if(DTLmap[l][m-1]==0||DTLmap[l][m-1]==3||DTLmap[l][m-1]==5)
{
DTLmap[l][m-1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m-1]==4||DTLmap[l][m-1]==7||DTLmap[l][m-1]==5)
{
if(DTLmap[l][m-2]==0||DTLmap[l][m-2]==3)
{
DTLmap[l][m-2]+=4;
DTLmap[l][m-1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 77:
if(DTLmap[l][m+1]==0||DTLmap[l][m+1]==3||DTLmap[l][m+1]==5)
{
DTLmap[l][m+1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m+1]==4||DTLmap[l][m+1]==7||DTLmap[l][m+1]==5)
{
if(DTLmap[l][m+2]==0||DTLmap[l][m+2]==3)
{
DTLmap[l][m+2]+=4;
DTLmap[l][m+1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTSmap[i][j]==5||DTSmap[i][j]==8||DTSmap[i][j]==11)
{
r=i;
c=j;
}
if(DTSmap[i][j]==6||DTSmap[i][j]==9||DTSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTSmap[r-1][c]==0||DTSmap[r-1][c]==3||DTSmap[r-1][c]==6)
{
DTSmap[r-1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r-1][c]==4||DTSmap[r-1][c]==7||DTSmap[r-1][c]==6)
{
if(DTSmap[r-2][c]==0||DTSmap[r-2][c]==3)
{
DTSmap[r-2][c]+=4;
DTSmap[r-1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTSmap[r+1][c]==0||DTSmap[r+1][c]==3||DTSmap[r+1][c]==6)
{
DTSmap[r+1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r+1][c]==4||DTSmap[r+1][c]==7||DTSmap[r+1][c]==6)
{
if(DTSmap[r+2][c]==0||DTSmap[r+2][c]==3)
{
DTSmap[r+2][c]+=4;
DTSmap[r+1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTSmap[r][c-1]==0||DTSmap[r][c-1]==3||DTSmap[r][c-1]==6)
{
DTSmap[r][c-1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c-1]==4||DTSmap[r][c-1]==7||DTSmap[r][c-1]==6)
{
if(DTSmap[r][c-2]==0||DTSmap[r][c-2]==3)
{
DTSmap[r][c-2]+=4;
DTSmap[r][c-1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTSmap[r][c+1]==0||DTSmap[r][c+1]==3||DTSmap[r][c+1]==6)
{
DTSmap[r][c+1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c+1]==4||DTSmap[r][c+1]==7||DTSmap[r][c+1]==6)
{
if(DTSmap[r][c+2]==0||DTSmap[r][c+2]==3)
{
DTSmap[r][c+2]+=4;
DTSmap[r][c+1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 72:
if(DTSmap[l-1][m]==0||DTSmap[l-1][m]==3||DTSmap[l-1][m]==5)
{
DTSmap[l-1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l-1][m]==4||DTSmap[l-1][m]==7||DTSmap[l-1][m]==5)
{
if(DTSmap[l-2][m]==0||DTSmap[l-2][m]==3)
{
DTSmap[l-2][m]+=4;
DTSmap[l-1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 80:
if(DTSmap[l+1][m]==0||DTSmap[l+1][m]==3||DTSmap[l+1][m]==5)
{
DTSmap[l+1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l+1][m]==4||DTSmap[l+1][m]==7||DTSmap[l+1][m]==5)
{
if(DTSmap[l+2][m]==0||DTSmap[l+2][m]==3)
{
DTSmap[l+2][m]+=4;
DTSmap[l+1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 75:
if(DTSmap[l][m-1]==0||DTSmap[l][m-1]==3||DTSmap[l][m-1]==5)
{
DTSmap[l][m-1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m-1]==4||DTSmap[l][m-1]==7||DTSmap[l][m-1]==5)
{
if(DTSmap[l][m-2]==0||DTSmap[l][m-2]==3)
{
DTSmap[l][m-2]+=4;
DTSmap[l][m-1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 77:
if(DTSmap[l][m+1]==0||DTSmap[l][m+1]==3||DTSmap[l][m+1]==5)
{
DTSmap[l][m+1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m+1]==4||DTSmap[l][m+1]==7||DTSmap[l][m+1]==5)
{
if(DTSmap[l][m+2]==0||DTSmap[l][m+2]==3)
{
DTSmap[l][m+2]+=4;
DTSmap[l][m+1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTYmap[i][j]==5||DTYmap[i][j]==8||DTYmap[i][j]==11)
{
r=i;
c=j;
}
if(DTYmap[i][j]==6||DTYmap[i][j]==9||DTYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
cout<<"1当前的坐标为:("<<r<<","<<c<<")"<<endl;
cout<<"2当前的坐标为:("<<l<<","<<m<<")"<<endl;
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTYmap[r-1][c]==0||DTYmap[r-1][c]==3||DTYmap[r-1][c]==6)
{
DTYmap[r-1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r-1][c]==4||DTYmap[r-1][c]==7||DTYmap[r-1][c]==6)
{
if(DTYmap[r-2][c]==0||DTYmap[r-2][c]==3)
{
DTYmap[r-2][c]+=4;
DTYmap[r-1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTYmap[r+1][c]==0||DTYmap[r+1][c]==3||DTYmap[r+1][c]==6)
{
DTYmap[r+1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r+1][c]==4||DTYmap[r+1][c]==7||DTYmap[r+1][c]==6)
{
if(DTYmap[r+2][c]==0||DTYmap[r+2][c]==3)
{
DTYmap[r+2][c]+=4;
DTYmap[r+1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTYmap[r][c-1]==0||DTYmap[r][c-1]==3||DTYmap[r][c-1]==6)
{
DTYmap[r][c-1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c-1]==4||DTYmap[r][c-1]==7||DTYmap[r][c-1]==6)
{
if(DTYmap[r][c-2]==0||DTYmap[r][c-2]==3)
{
DTYmap[r][c-2]+=4;
DTYmap[r][c-1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTYmap[r][c+1]==0||DTYmap[r][c+1]==3||DTYmap[r][c+1]==6)
{
DTYmap[r][c+1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c+1]==4||DTYmap[r][c+1]==7||DTYmap[r][c+1]==6)
{
if(DTYmap[r][c+2]==0||DTYmap[r][c+2]==3)
{
DTYmap[r][c+2]+=4;
DTYmap[r][c+1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 72:
if(DTYmap[l-1][m]==0||DTYmap[l-1][m]==3||DTYmap[l-1][m]==5)
{
DTYmap[l-1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l-1][m]==4||DTYmap[l-1][m]==7||DTYmap[l-1][m]==5)
{
if(DTYmap[l-2][m]==0||DTYmap[l-2][m]==3)
{
DTYmap[l-2][m]+=4;
DTYmap[l-1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 80:
if(DTYmap[l+1][m]==0||DTYmap[l+1][m]==3||DTYmap[l+1][m]==5)
{
DTYmap[l+1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l+1][m]==4||DTYmap[l+1][m]==7||DTYmap[l+1][m]==5)
{
if(DTYmap[l+2][m]==0||DTYmap[l+2][m]==3)
{
DTYmap[l+2][m]+=4;
DTYmap[l+1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 75:
if(DTYmap[l][m-1]==0||DTYmap[l][m-1]==3||DTYmap[l][m-1]==5)
{
DTYmap[l][m-1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m-1]==4||DTYmap[l][m-1]==7||DTYmap[l][m-1]==5)
{
if(DTYmap[l][m-2]==0||DTYmap[l][m-2]==3)
{
DTYmap[l][m-2]+=4;
DTYmap[l][m-1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 77:
if(DTYmap[l][m+1]==0||DTYmap[l][m+1]==3||DTYmap[l][m+1]==5)
{
DTYmap[l][m+1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m+1]==4||DTYmap[l][m+1]==7||DTYmap[l][m+1]==5)
{
if(DTYmap[l][m+2]==0||DTYmap[l][m+2]==3)
{
DTYmap[l][m+2]+=4;
DTYmap[l][m+1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
else if(g==8)
{
//2人导弹模式(无坐标)
if(e=='W')
{
if(d=='J')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWJmap[i][j]==5||DWJmap[i][j]==8||DWJmap[i][j]==11)
{
r=i;
c=j;
}
if(DWJmap[i][j]==6||DWJmap[i][j]==9||DWJmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
int ch;
ch=_getch();
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWJmap[r][c]==DWJmap[x][y]) z1=0;
if(DWJmap[l][m]==DWJmap[x][y]) z2=0;
if(z1==0)
{
DWJmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWJmap[l][m]-=6;
z1+=2;
}
switch(ch)
{
case 'W':
case 'w':
if((DWJmap[r-1][c]==0||DWJmap[r-1][c]==3||DWJmap[r-1][c]==6)&&(z1==1))
{
DWJmap[r-1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r-1][c]==4||DWJmap[r-1][c]==7||DWJmap[r-1][c]==6)&&(z1==1))
{
if((DWJmap[r-2][c]==0||DWJmap[r-2][c]==3)&&(z1==1))
{
DWJmap[r-2][c]+=4;
DWJmap[r-1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWJmap[r+1][c]==0||DWJmap[r+1][c]==3||DWJmap[r+1][c]==6)&&(z1==1))
{
DWJmap[r+1][c]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r+1][c]==4||DWJmap[r+1][c]==7||DWJmap[r+1][c]==6)&&(z1==1))
{
if(DWJmap[r+2][c]==0||DWJmap[r+2][c]==3)
{
DWJmap[r+2][c]+=4;
DWJmap[r+1][c]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWJmap[r][c-1]==0||DWJmap[r][c-1]==3||DWJmap[r][c-1]==6)&&(z1==1))
{
DWJmap[r][c-1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c-1]==4||DWJmap[r][c-1]==7||DWJmap[r][c-1]==6)&&(z1==1))
{
if(DWJmap[r][c-2]==0||DWJmap[r][c-2]==3)
{
DWJmap[r][c-2]+=4;
DWJmap[r][c-1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWJmap[r][c+1]==0||DWJmap[r][c+1]==3||DWJmap[r][c+1]==6)&&(z1==1))
{
DWJmap[r][c+1]+=5;
DWJmap[r][c]-=5;
}
else if((DWJmap[r][c+1]==4||DWJmap[r][c+1]==7||DWJmap[r][c+1]==6)&&(z1==1))
{
if(DWJmap[r][c+2]==0||DWJmap[r][c+2]==3)
{
DWJmap[r][c+2]+=4;
DWJmap[r][c+1]+=1;
DWJmap[r][c]-=5;
}
}
break;
case 72:
if((DWJmap[l-1][m]==0||DWJmap[l-1][m]==3||DWJmap[l-1][m]==5)&&(z2==1))
{
DWJmap[l-1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l-1][m]==4||DWJmap[l-1][m]==7||DWJmap[l-1][m]==5)&&(z2==1))
{
if(DWJmap[l-2][m]==0||DWJmap[l-2][m]==3)
{
DWJmap[l-2][m]+=4;
DWJmap[l-1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 80:
if((DWJmap[l+1][m]==0||DWJmap[l+1][m]==3||DWJmap[l+1][m]==5)&&(z2==1))
{
DWJmap[l+1][m]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l+1][m]==4||DWJmap[l+1][m]==7||DWJmap[l+1][m]==5)&&(z2==1))
{
if(DWJmap[l+2][m]==0||DWJmap[l+2][m]==3)
{
DWJmap[l+2][m]+=4;
DWJmap[l+1][m]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 75:
if((DWJmap[l][m-1]==0||DWJmap[l][m-1]==3||DWJmap[l][m-1]==5)&&(z2==1))
{
DWJmap[l][m-1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m-1]==4||DWJmap[l][m-1]==7||DWJmap[l][m-1]==5)&&(z2==1))
{
if(DWJmap[l][m-2]==0||DWJmap[l][m-2]==3)
{
DWJmap[l][m-2]+=4;
DWJmap[l][m-1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 77:
if((DWJmap[l][m+1]==0||DWJmap[l][m+1]==3||DWJmap[l][m+1]==5)&&(z2==1))
{
DWJmap[l][m+1]+=6;
DWJmap[l][m]-=6;
}
else if((DWJmap[l][m+1]==4||DWJmap[l][m+1]==7||DWJmap[l][m+1]==5)&&(z2==1))
{
if(DWJmap[l][m+2]==0||DWJmap[l][m+2]==3)
{
DWJmap[l][m+2]+=4;
DWJmap[l][m+1]+=2;
DWJmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='P')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWPmap[i][j]==5||DWPmap[i][j]==8||DWPmap[i][j]==11)
{
r=i;
c=j;
}
if(DWPmap[i][j]==6||DWPmap[i][j]==9||DWPmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWPmap[r][c]==DWPmap[x][y]) z1=0;
if(DWPmap[l][m]==DWPmap[x][y]) z2=0;
if(z1==0)
{
DWPmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWPmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWPmap[r-1][c]==0||DWPmap[r-1][c]==3||DWPmap[r-1][c]==6)&&(z1==1))
{
DWPmap[r-1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r-1][c]==4||DWPmap[r-1][c]==7||DWPmap[r-1][c]==6)&&(z1==1))
{
if((DWPmap[r-2][c]==0||DWPmap[r-2][c]==3)&&(z1==1))
{
DWPmap[r-2][c]+=4;
DWPmap[r-1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWPmap[r+1][c]==0||DWPmap[r+1][c]==3||DWPmap[r+1][c]==6)&&(z1==1))
{
DWPmap[r+1][c]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r+1][c]==4||DWPmap[r+1][c]==7||DWPmap[r+1][c]==6)&&(z1==1))
{
if(DWPmap[r+2][c]==0||DWPmap[r+2][c]==3)
{
DWPmap[r+2][c]+=4;
DWPmap[r+1][c]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWPmap[r][c-1]==0||DWPmap[r][c-1]==3||DWPmap[r][c-1]==6)&&(z1==1))
{
DWPmap[r][c-1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c-1]==4||DWPmap[r][c-1]==7||DWPmap[r][c-1]==6)&&(z1==1))
{
if(DWPmap[r][c-2]==0||DWPmap[r][c-2]==3)
{
DWPmap[r][c-2]+=4;
DWPmap[r][c-1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWPmap[r][c+1]==0||DWPmap[r][c+1]==3||DWPmap[r][c+1]==6)&&(z1==1))
{
DWPmap[r][c+1]+=5;
DWPmap[r][c]-=5;
}
else if((DWPmap[r][c+1]==4||DWPmap[r][c+1]==7||DWPmap[r][c+1]==6)&&(z1==1))
{
if(DWPmap[r][c+2]==0||DWPmap[r][c+2]==3)
{
DWPmap[r][c+2]+=4;
DWPmap[r][c+1]+=1;
DWPmap[r][c]-=5;
}
}
break;
case 72:
if((DWPmap[l-1][m]==0||DWPmap[l-1][m]==3||DWPmap[l-1][m]==5)&&(z2==1))
{
DWPmap[l-1][m]+=6;
DWPmap[l][m]-=6;
}
else if((DWPmap[l-1][m]==4||DWPmap[l-1][m]==7||DWPmap[l-1][m]==5)&&(z2==1))
{
if(DWPmap[l-2][m]==0||DWPmap[l-2][m]==3)
{
DWPmap[l-2][m]+=4;
DWPmap[l-1][m]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 80:
if((DWPmap[l+1][m]==0||DWPmap[l+1][m]==3||DWPmap[l+1][m]==5)&&(z2==1))
{
DWPmap[l+1][m]+=6;
DWPmap[l][m]-=6;
}
else if((WPmap[l+1][m]==4||WPmap[l+1][m]==7||WPmap[l+1][m]==5)&&(z2==1))
{
if(WPmap[l+2][m]==0||WPmap[l+2][m]==3)
{
WPmap[l+2][m]+=4;
WPmap[l+1][m]+=2;
WPmap[l][m]-=6;
}
}
break;
case 75:
if((WPmap[l][m-1]==0||WPmap[l][m-1]==3||WPmap[l][m-1]==5)&&(z2==1))
{
WPmap[l][m-1]+=6;
WPmap[l][m]-=6;
}
else if((DWPmap[l][m-1]==4||DWPmap[l][m-1]==7||DWPmap[l][m-1]==5)&&(z2==1))
{
if(DWPmap[l][m-2]==0||DWPmap[l][m-2]==3)
{
DWPmap[l][m-2]+=4;
DWPmap[l][m-1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 77:
if((DWPmap[l][m+1]==0||DWPmap[l][m+1]==3||DWPmap[l][m+1]==5)&&(z2==1))
{
DWPmap[l][m+1]+=6;
DWPmap[l][m]-=6;
}
else if(DWPmap[l][m+1]==4||DWPmap[l][m+1]==7||DWPmap[l][m+1]==5)
{
if(DWPmap[l][m+2]==0||DWPmap[l][m+2]==3)
{
DWPmap[l][m+2]+=4;
DWPmap[l][m+1]+=2;
DWPmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(d=='K')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DWKmap[i][j]==5||DWKmap[i][j]==8||DWKmap[i][j]==11)
{
r=i;
c=j;
}
if(DWKmap[i][j]==6||DWKmap[i][j]==9||DWKmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DWKmap[r][c]==DWKmap[x][y]) z1=0;
if(DWKmap[l][m]==DWKmap[x][y]) z2=0;
if(z1==0)
{
DWKmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DWKmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if((DWKmap[r-1][c]==0||DWKmap[r-1][c]==3||DWKmap[r-1][c]==6)&&(z1==1))
{
WKmap[r-1][c]+=5;
WKmap[r][c]-=5;
}
else if((DWKmap[r-1][c]==4||DWKmap[r-1][c]==7||DWKmap[r-1][c]==6)&&(z1==1))
{
if(DWKmap[r-2][c]==0||DWKmap[r-2][c]==3)
{
DWKmap[r-2][c]+=4;
DWKmap[r-1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if((DWKmap[r+1][c]==0||DWKmap[r+1][c]==3||DWKmap[r+1][c]==6)&&(z1==1))
{
DWKmap[r+1][c]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r+1][c]==4||DWKmap[r+1][c]==7||DWKmap[r+1][c]==6)&&(z1==1))
{
if(DWKmap[r+2][c]==0||DWKmap[r+2][c]==3)
{
DWKmap[r+2][c]+=4;
DWKmap[r+1][c]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if((DWKmap[r][c-1]==0||DWKmap[r][c-1]==3||DWKmap[r][c-1]==6)&&(z1==1))
{
DWKmap[r][c-1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c-1]==4||DWKmap[r][c-1]==7||DWKmap[r][c-1]==6)&&(z1==1))
{
if(DWKmap[r][c-2]==0||DWKmap[r][c-2]==3)
{
DWKmap[r][c-2]+=4;
DWKmap[r][c-1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if((DWKmap[r][c+1]==0||DWKmap[r][c+1]==3||DWKmap[r][c+1]==6)&&(z1==1))
{
DWKmap[r][c+1]+=5;
DWKmap[r][c]-=5;
}
else if((DWKmap[r][c+1]==4||DWKmap[r][c+1]==7||DWKmap[r][c+1]==6)&&(z2==1))
{
if(DWKmap[r][c+2]==0||DWKmap[r][c+2]==3)
{
DWKmap[r][c+2]+=4;
DWKmap[r][c+1]+=1;
DWKmap[r][c]-=5;
}
}
break;
case 72:
if((DWKmap[l-1][m]==0||DWKmap[l-1][m]==3||DWKmap[l-1][m]==5)&&(z2==1))
{
DWKmap[l-1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l-1][m]==4||DWKmap[l-1][m]==7||DWKmap[l-1][m]==5)&&(z2==1))
{
if((DWKmap[l-2][m]==0||DWKmap[l-2][m]==3)&&(z2==1))
{
DWKmap[l-2][m]+=4;
DWKmap[l-1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 80:
if((DWKmap[l+1][m]==0||DWKmap[l+1][m]==3||DWKmap[l+1][m]==5)&&(z2==1))
{
DWKmap[l+1][m]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l+1][m]==4||DWKmap[l+1][m]==7||DWKmap[l+1][m]==5)&&(z2==1))
{
if(DWKmap[l+2][m]==0||DWKmap[l+2][m]==3)
{
DWKmap[l+2][m]+=4;
DWKmap[l+1][m]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 75:
if((DWKmap[l][m-1]==0||DWKmap[l][m-1]==3||DWKmap[l][m-1]==5)&&(z2==1))
{
DWKmap[l][m-1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m-1]==4||DWKmap[l][m-1]==7||DWKmap[l][m-1]==5)&&(z2==1))
{
if((DWKmap[l][m-2]==0||DWKmap[l][m-2]==3)&&(z2==1))
{
DWKmap[l][m-2]+=4;
DWKmap[l][m-1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 77:
if((DWKmap[l][m+1]==0||WKmap[l][m+1]==3||WKmap[l][m+1]==5)&&(z2==1))
{
DWKmap[l][m+1]+=6;
DWKmap[l][m]-=6;
}
else if((DWKmap[l][m+1]==4||DWKmap[l][m+1]==7||DWKmap[l][m+1]==5)&&(z2==1))
{
if(DWKmap[l][m+2]==0||DWKmap[l][m+2]==3)
{
DWKmap[l][m+2]+=4;
DWKmap[l][m+1]+=2;
DWKmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
if(e=='T')
{
if(f=='L')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTLmap[i][j]==5||DTLmap[i][j]==8||DTLmap[i][j]==11)
{
r=i;
c=j;
}
if(DTLmap[i][j]==6||DTLmap[i][j]==9||DTLmap[i][j]==11)
{
l=i;
m=j;
}
}
}
int ch;
ch=_getch();
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTLmap[r][c]==DTLmap[x][y]) z1=0;
if(DTLmap[l][m]==DTLmap[x][y]) z2=0;
if(z1==0)
{
DTLmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTLmap[l][m]-=6;
z1+=2;
}
switch(ch)
{
case 'W':
case 'w':
if(DTLmap[r-1][c]==0||DTLmap[r-1][c]==3||DTLmap[r-1][c]==6)
{
DTLmap[r-1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r-1][c]==4||DTLmap[r-1][c]==7||DTLmap[r-1][c]==6)
{
if(DTLmap[r-2][c]==0||DTLmap[r-2][c]==3)
{
DTLmap[r-2][c]+=4;
DTLmap[r-1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTLmap[r+1][c]==0||DTLmap[r+1][c]==3||DTLmap[r+1][c]==6)
{
DTLmap[r+1][c]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r+1][c]==4||DTLmap[r+1][c]==7||DTLmap[r+1][c]==6)
{
if(DTLmap[r+2][c]==0||DTLmap[r+2][c]==3)
{
DTLmap[r+2][c]+=4;
DTLmap[r+1][c]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTLmap[r][c-1]==0||DTLmap[r][c-1]==3||DTLmap[r][c-1]==6)
{
DTLmap[r][c-1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c-1]==4||DTLmap[r][c-1]==7||DTLmap[r][c-1]==6)
{
if(DTLmap[r][c-2]==0||DTLmap[r][c-2]==3)
{
DTLmap[r][c-2]+=4;
DTLmap[r][c-1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTLmap[r][c+1]==0||DTLmap[r][c+1]==3||DTLmap[r][c+1]==6)
{
DTLmap[r][c+1]+=5;
DTLmap[r][c]-=5;
}
else if(DTLmap[r][c+1]==4||DTLmap[r][c+1]==7||DTLmap[r][c+1]==6)
{
if(DTLmap[r][c+2]==0||DTLmap[r][c+2]==3)
{
DTLmap[r][c+2]+=4;
DTLmap[r][c+1]+=1;
DTLmap[r][c]-=5;
}
}
break;
case 72:
if(DTLmap[l-1][m]==0||DTLmap[l-1][m]==3||DTLmap[l-1][m]==5)
{
DTLmap[l-1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l-1][m]==4||DTLmap[l-1][m]==7||DTLmap[l-1][m]==5)
{
if(DTLmap[l-2][m]==0||DTLmap[l-2][m]==3)
{
DTLmap[l-2][m]+=4;
DTLmap[l-1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 80:
if(DTLmap[l+1][m]==0||DTLmap[l+1][m]==3||DTLmap[l+1][m]==5)
{
DTLmap[l+1][m]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l+1][m]==4||DTLmap[l+1][m]==7||DTLmap[l+1][m]==5)
{
if(DTLmap[l+2][m]==0||DTLmap[l+2][m]==3)
{
DTLmap[l+2][m]+=4;
DTLmap[l+1][m]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 75:
if(DTLmap[l][m-1]==0||DTLmap[l][m-1]==3||DTLmap[l][m-1]==5)
{
DTLmap[l][m-1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m-1]==4||DTLmap[l][m-1]==7||DTLmap[l][m-1]==5)
{
if(DTLmap[l][m-2]==0||DTLmap[l][m-2]==3)
{
DTLmap[l][m-2]+=4;
DTLmap[l][m-1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 77:
if(DTLmap[l][m+1]==0||DTLmap[l][m+1]==3||DTLmap[l][m+1]==5)
{
DTLmap[l][m+1]+=6;
DTLmap[l][m]-=6;
}
else if(DTLmap[l][m+1]==4||DTLmap[l][m+1]==7||DTLmap[l][m+1]==5)
{
if(DTLmap[l][m+2]==0||DTLmap[l][m+2]==3)
{
DTLmap[l][m+2]+=4;
DTLmap[l][m+1]+=2;
DTLmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='S')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTSmap[i][j]==5||DTSmap[i][j]==8||DTSmap[i][j]==11)
{
r=i;
c=j;
}
if(DTSmap[i][j]==6||DTSmap[i][j]==9||DTSmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTSmap[r][c]==DTSmap[x][y]) z1=0;
if(DTSmap[l][m]==DTSmap[x][y]) z2=0;
if(z1==0)
{
DTSmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTSmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTSmap[r-1][c]==0||DTSmap[r-1][c]==3||DTSmap[r-1][c]==6)
{
DTSmap[r-1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r-1][c]==4||DTSmap[r-1][c]==7||DTSmap[r-1][c]==6)
{
if(DTSmap[r-2][c]==0||DTSmap[r-2][c]==3)
{
DTSmap[r-2][c]+=4;
DTSmap[r-1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTSmap[r+1][c]==0||DTSmap[r+1][c]==3||DTSmap[r+1][c]==6)
{
DTSmap[r+1][c]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r+1][c]==4||DTSmap[r+1][c]==7||DTSmap[r+1][c]==6)
{
if(DTSmap[r+2][c]==0||DTSmap[r+2][c]==3)
{
DTSmap[r+2][c]+=4;
DTSmap[r+1][c]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTSmap[r][c-1]==0||DTSmap[r][c-1]==3||DTSmap[r][c-1]==6)
{
DTSmap[r][c-1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c-1]==4||DTSmap[r][c-1]==7||DTSmap[r][c-1]==6)
{
if(DTSmap[r][c-2]==0||DTSmap[r][c-2]==3)
{
DTSmap[r][c-2]+=4;
DTSmap[r][c-1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTSmap[r][c+1]==0||DTSmap[r][c+1]==3||DTSmap[r][c+1]==6)
{
DTSmap[r][c+1]+=5;
DTSmap[r][c]-=5;
}
else if(DTSmap[r][c+1]==4||DTSmap[r][c+1]==7||DTSmap[r][c+1]==6)
{
if(DTSmap[r][c+2]==0||DTSmap[r][c+2]==3)
{
DTSmap[r][c+2]+=4;
DTSmap[r][c+1]+=1;
DTSmap[r][c]-=5;
}
}
break;
case 72:
if(DTSmap[l-1][m]==0||DTSmap[l-1][m]==3||DTSmap[l-1][m]==5)
{
DTSmap[l-1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l-1][m]==4||DTSmap[l-1][m]==7||DTSmap[l-1][m]==5)
{
if(DTSmap[l-2][m]==0||DTSmap[l-2][m]==3)
{
DTSmap[l-2][m]+=4;
DTSmap[l-1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 80:
if(DTSmap[l+1][m]==0||DTSmap[l+1][m]==3||DTSmap[l+1][m]==5)
{
DTSmap[l+1][m]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l+1][m]==4||DTSmap[l+1][m]==7||DTSmap[l+1][m]==5)
{
if(DTSmap[l+2][m]==0||DTSmap[l+2][m]==3)
{
DTSmap[l+2][m]+=4;
DTSmap[l+1][m]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 75:
if(DTSmap[l][m-1]==0||DTSmap[l][m-1]==3||DTSmap[l][m-1]==5)
{
DTSmap[l][m-1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m-1]==4||DTSmap[l][m-1]==7||DTSmap[l][m-1]==5)
{
if(DTSmap[l][m-2]==0||DTSmap[l][m-2]==3)
{
DTSmap[l][m-2]+=4;
DTSmap[l][m-1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 77:
if(DTSmap[l][m+1]==0||DTSmap[l][m+1]==3||DTSmap[l][m+1]==5)
{
DTSmap[l][m+1]+=6;
DTSmap[l][m]-=6;
}
else if(DTSmap[l][m+1]==4||DTSmap[l][m+1]==7||DTSmap[l][m+1]==5)
{
if(DTSmap[l][m+2]==0||DTSmap[l][m+2]==3)
{
DTSmap[l][m+2]+=4;
DTSmap[l][m+1]+=2;
DTSmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
if(f=='Y')
{
int r,c,l,m;
for(int i=0;i<R;i++)
{
for(int j=0;j<C;j++)
{
if(DTYmap[i][j]==5||DTYmap[i][j]==8||DTYmap[i][j]==11)
{
r=i;
c=j;
}
if(DTYmap[i][j]==6||DTYmap[i][j]==9||DTYmap[i][j]==11)
{
l=i;
m=j;
}
}
}
if(z1==0&&z2==0)
{
cout<<"两个人都被炸死了!"<<endl;
flag=false;
}
if(z1==0) cout<<"1被炸死了!!"<<endl;
if(z2==0) cout<<"2被炸死了!!"<<endl;
srand(time(NULL));
int x,y;
x=rand()%16+1;
y=rand()%16+1;
if(DTYmap[r][c]==DTYmap[x][y]) z1=0;
if(DTYmap[l][m]==DTYmap[x][y]) z2=0;
if(z1==0)
{
DTYmap[r][c]-=5;
z1+=2;
}
if(z2==0)
{
DTYmap[l][m]-=6;
z1+=2;
}
int ch;
ch=_getch();
switch(ch)
{
case 'W':
case 'w':
if(DTYmap[r-1][c]==0||DTYmap[r-1][c]==3||DTYmap[r-1][c]==6)
{
DTYmap[r-1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r-1][c]==4||DTYmap[r-1][c]==7||DTYmap[r-1][c]==6)
{
if(DTYmap[r-2][c]==0||DTYmap[r-2][c]==3)
{
DTYmap[r-2][c]+=4;
DTYmap[r-1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'S':
case 's':
if(DTYmap[r+1][c]==0||DTYmap[r+1][c]==3||DTYmap[r+1][c]==6)
{
DTYmap[r+1][c]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r+1][c]==4||DTYmap[r+1][c]==7||DTYmap[r+1][c]==6)
{
if(DTYmap[r+2][c]==0||DTYmap[r+2][c]==3)
{
DTYmap[r+2][c]+=4;
DTYmap[r+1][c]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'A':
case 'a':
if(DTYmap[r][c-1]==0||DTYmap[r][c-1]==3||DTYmap[r][c-1]==6)
{
DTYmap[r][c-1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c-1]==4||DTYmap[r][c-1]==7||DTYmap[r][c-1]==6)
{
if(DTYmap[r][c-2]==0||DTYmap[r][c-2]==3)
{
DTYmap[r][c-2]+=4;
DTYmap[r][c-1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 'D':
case 'd':
if(DTYmap[r][c+1]==0||DTYmap[r][c+1]==3||DTYmap[r][c+1]==6)
{
DTYmap[r][c+1]+=5;
DTYmap[r][c]-=5;
}
else if(DTYmap[r][c+1]==4||DTYmap[r][c+1]==7||DTYmap[r][c+1]==6)
{
if(DTYmap[r][c+2]==0||DTYmap[r][c+2]==3)
{
DTYmap[r][c+2]+=4;
DTYmap[r][c+1]+=1;
DTYmap[r][c]-=5;
}
}
break;
case 72:
if(DTYmap[l-1][m]==0||DTYmap[l-1][m]==3||DTYmap[l-1][m]==5)
{
DTYmap[l-1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l-1][m]==4||DTYmap[l-1][m]==7||DTYmap[l-1][m]==5)
{
if(DTYmap[l-2][m]==0||DTYmap[l-2][m]==3)
{
DTYmap[l-2][m]+=4;
DTYmap[l-1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 80:
if(DTYmap[l+1][m]==0||DTYmap[l+1][m]==3||DTYmap[l+1][m]==5)
{
DTYmap[l+1][m]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l+1][m]==4||DTYmap[l+1][m]==7||DTYmap[l+1][m]==5)
{
if(DTYmap[l+2][m]==0||DTYmap[l+2][m]==3)
{
DTYmap[l+2][m]+=4;
DTYmap[l+1][m]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 75:
if(DTYmap[l][m-1]==0||DTYmap[l][m-1]==3||DTYmap[l][m-1]==5)
{
DTYmap[l][m-1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m-1]==4||DTYmap[l][m-1]==7||DTYmap[l][m-1]==5)
{
if(DTYmap[l][m-2]==0||DTYmap[l][m-2]==3)
{
DTYmap[l][m-2]+=4;
DTYmap[l][m-1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 77:
if(DTYmap[l][m+1]==0||DTYmap[l][m+1]==3||DTYmap[l][m+1]==5)
{
DTYmap[l][m+1]+=6;
DTYmap[l][m]-=6;
}
else if(DTYmap[l][m+1]==4||DTYmap[l][m+1]==7||DTYmap[l][m+1]==5)
{
if(DTYmap[l][m+2]==0||DTYmap[l][m+2]==3)
{
DTYmap[l][m+2]+=4;
DTYmap[l][m+1]+=2;
DTYmap[l][m]-=6;
}
}
break;
case 'Q':
case 'q':
flag=false;
default:
break;
}
}
}
return ;
}
return ;
}
int finish()//判断结束了没有(全部推进去没有)
{
if(g==1)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WJmap[i][j] == 4)//遍历地图,如果有1个箱子,就没有推完,否则推完了
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==2)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==3)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==6)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (TYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==4)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==5)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==7)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
else if(g==8)
{
if(e=='W')
{
if(d=='J')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWJmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='P')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DWPmap[i][j] == 4)
{
return 0;
}
}
}
}
if(d=='K')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (WKmap[i][j] == 4)
{
return 0;
}
}
}
}
}
if(e=='T')
{
if(f=='L')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTLmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='S')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTSmap[i][j] == 4)
{
return 0;
}
}
}
}
if(f=='Y')
{
for (int i=0;i<R;i++)
{
for (int j=0;j<C;j++)
{
if (DTYmap[i][j] == 4)
{
return 0;
}
}
}
}
}
return 1;
}
}
void setmap(int n,int c,char a,char b)//用来设置地图
{
if(c==3)
{
z1=1;
}
else if(c==5)
{
z1=1;
z2=1;
}
else if(c==6)
{
z1=1;
}
else if(c==8)
{
z1=1;
z2=1;
}
//以上为导弹模式将两人都复活
//以下为设置地图
if(c==1)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(WJmap, WJmap1, sizeof(WJmap1));
}
if (n == 2)
{
memcpy(WJmap, WJmap2, sizeof(WJmap2));
}
if (n == 3)
{
memcpy(WJmap, WJmap3, sizeof(WJmap3));
}
if( n == 4)
{
memcpy(WJmap, WJmap4, sizeof(WJmap4));
}
if(n==5)
{
memcpy(WJmap, WJmap5, sizeof(WJmap5));
}
if(n==6)
{
memcpy(WJmap, WJmap6, sizeof(WJmap6));
}
if(n==7)
{
memcpy(WJmap, WJmap7, sizeof(WJmap7));
}
if(n==8)
{
memcpy(WJmap, WJmap8, sizeof(WJmap8));
}
if(n==9)
{
memcpy(WJmap, WJmap9, sizeof(WJmap9));
}
if(n==10)
{
memcpy(WJmap, WJmap10, sizeof(WJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(WPmap, WPmap1, sizeof(WPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(WKmap, WKmap1, sizeof(WKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(TLmap, TLmap1, sizeof(TLmap1));
}
if(n==2)
{
memcpy(TLmap, TLmap2, sizeof(TLmap2));
}
if(n==3)
{
memcpy(TLmap, TLmap3, sizeof(TLmap3));
}
if(n==4)
{
memcpy(TLmap, TLmap4, sizeof(TLmap4));
}
if(n==5)
{
memcpy(TLmap, TLmap5, sizeof(TLmap5));
}
if(n==6)
{
memcpy(TLmap, TLmap6, sizeof(TLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(TSmap, TSmap1, sizeof(TSmap1));
}
if(n==2)
{
memcpy(TSmap, TSmap2, sizeof(TSmap2));
}
if(n==3)
{
memcpy(TSmap, TSmap3, sizeof(TSmap3));
}
if(n==4)
{
memcpy(TSmap, TSmap4, sizeof(TSmap4));
}
if(n==5)
{
memcpy(TSmap, TSmap5, sizeof(TSmap5));
}
if(n==6)
{
memcpy(TSmap, TSmap6, sizeof(TSmap6));
}
if(n==7)
{
memcpy(TSmap, TSmap7, sizeof(TSmap7));
}
if(n==8)
{
memcpy(TSmap, TSmap8, sizeof(TSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(TYmap, TYmap1, sizeof(TYmap1));
}
if(n==2)
{
memcpy(TYmap, TYmap2, sizeof(TYmap2));
}
if(n==3)
{
memcpy(TYmap, TYmap3, sizeof(TYmap3));
}
if(n==4)
{
memcpy(TYmap, TYmap4, sizeof(TYmap4));
}
if(n==5)
{
memcpy(TYmap, TYmap5, sizeof(TYmap5));
}
if(n==6)
{
memcpy(TYmap, TYmap6, sizeof(TYmap6));
}
return ;
}
}
}
if(c==2)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(WJmap, WJmap1, sizeof(WJmap1));
}
if (n == 2)
{
memcpy(WJmap, WJmap2, sizeof(WJmap2));
}
if (n == 3)
{
memcpy(WJmap, WJmap3, sizeof(WJmap3));
}
if( n == 4)
{
memcpy(WJmap, WJmap4, sizeof(WJmap4));
}
if(n==5)
{
memcpy(WJmap, WJmap5, sizeof(WJmap5));
}
if(n==6)
{
memcpy(WJmap, WJmap6, sizeof(WJmap6));
}
if(n==7)
{
memcpy(WJmap, WJmap7, sizeof(WJmap7));
}
if(n==8)
{
memcpy(WJmap, WJmap8, sizeof(WJmap8));
}
if(n==9)
{
memcpy(WJmap, WJmap9, sizeof(WJmap9));
}
if(n==10)
{
memcpy(WJmap, WJmap10, sizeof(WJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(WPmap, WPmap1, sizeof(WPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(WKmap, WKmap1, sizeof(WKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(TLmap, TLmap1, sizeof(TLmap1));
}
if(n==2)
{
memcpy(TLmap, TLmap2, sizeof(TLmap2));
}
if(n==3)
{
memcpy(TLmap, TLmap3, sizeof(TLmap3));
}
if(n==4)
{
memcpy(TLmap, TLmap4, sizeof(TLmap4));
}
if(n==5)
{
memcpy(TLmap, TLmap5, sizeof(TLmap5));
}
if(n==6)
{
memcpy(TLmap, TLmap6, sizeof(TLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(TSmap, TSmap1, sizeof(TSmap1));
}
if(n==2)
{
memcpy(TSmap, TSmap2, sizeof(TSmap2));
}
if(n==3)
{
memcpy(TSmap, TSmap3, sizeof(TSmap3));
}
if(n==4)
{
memcpy(TSmap, TSmap4, sizeof(TSmap4));
}
if(n==5)
{
memcpy(TSmap, TSmap5, sizeof(TSmap5));
}
if(n==6)
{
memcpy(TSmap, TSmap6, sizeof(TSmap6));
}
if(n==7)
{
memcpy(TSmap, TSmap7, sizeof(TSmap7));
}
if(n==8)
{
memcpy(TSmap, TSmap8, sizeof(TSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(TYmap, TYmap1, sizeof(TYmap1));
}
if(n==2)
{
memcpy(TYmap, TYmap2, sizeof(TYmap2));
}
if(n==3)
{
memcpy(TYmap, TYmap3, sizeof(TYmap3));
}
if(n==4)
{
memcpy(TYmap, TYmap4, sizeof(TYmap4));
}
if(n==5)
{
memcpy(TYmap, TYmap5, sizeof(TYmap5));
}
if(n==6)
{
memcpy(TYmap, TYmap6, sizeof(TYmap6));
}
return ;
}
}
}
if(c==3)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(WJmap, WJmap1, sizeof(WJmap1));
}
if (n == 2)
{
memcpy(WJmap, WJmap2, sizeof(WJmap2));
}
if (n == 3)
{
memcpy(WJmap, WJmap3, sizeof(WJmap3));
}
if( n == 4)
{
memcpy(WJmap, WJmap4, sizeof(WJmap4));
}
if(n==5)
{
memcpy(WJmap, WJmap5, sizeof(WJmap5));
}
if(n==6)
{
memcpy(WJmap, WJmap6, sizeof(WJmap6));
}
if(n==7)
{
memcpy(WJmap, WJmap7, sizeof(WJmap7));
}
if(n==8)
{
memcpy(WJmap, WJmap8, sizeof(WJmap8));
}
if(n==9)
{
memcpy(WJmap, WJmap9, sizeof(WJmap9));
}
if(n==10)
{
memcpy(WJmap, WJmap10, sizeof(WJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(WPmap, WPmap1, sizeof(WPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(WKmap, WKmap1, sizeof(WKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(TLmap, TLmap1, sizeof(TLmap1));
}
if(n==2)
{
memcpy(TLmap, TLmap2, sizeof(TLmap2));
}
if(n==3)
{
memcpy(TLmap, TLmap3, sizeof(TLmap3));
}
if(n==4)
{
memcpy(TLmap, TLmap4, sizeof(TLmap4));
}
if(n==5)
{
memcpy(TLmap, TLmap5, sizeof(TLmap5));
}
if(n==6)
{
memcpy(TLmap, TLmap6, sizeof(TLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(TSmap, TSmap1, sizeof(TSmap1));
}
if(n==2)
{
memcpy(TSmap, TSmap2, sizeof(TSmap2));
}
if(n==3)
{
memcpy(TSmap, TSmap3, sizeof(TSmap3));
}
if(n==4)
{
memcpy(TSmap, TSmap4, sizeof(TSmap4));
}
if(n==5)
{
memcpy(TSmap, TSmap5, sizeof(TSmap5));
}
if(n==6)
{
memcpy(TSmap, TSmap6, sizeof(TSmap6));
}
if(n==7)
{
memcpy(TSmap, TSmap7, sizeof(TSmap7));
}
if(n==8)
{
memcpy(TSmap, TSmap8, sizeof(TSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(TYmap, TYmap1, sizeof(TYmap1));
}
if(n==2)
{
memcpy(TYmap, TYmap2, sizeof(TYmap2));
}
if(n==3)
{
memcpy(TYmap, TYmap3, sizeof(TYmap3));
}
if(n==4)
{
memcpy(TYmap, TYmap4, sizeof(TYmap4));
}
if(n==5)
{
memcpy(TYmap, TYmap5, sizeof(TYmap5));
}
if(n==6)
{
memcpy(TYmap, TYmap6, sizeof(TYmap6));
}
return ;
}
}
}
if(c==4)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(DWJmap, DWJmap1, sizeof(DWJmap1));
}
if (n == 2)
{
memcpy(DWJmap, DWJmap2, sizeof(DWJmap2));
}
if (n == 3)
{
memcpy(DWJmap, DWJmap3, sizeof(DWJmap3));
}
if( n == 4)
{
memcpy(DWJmap, DWJmap4, sizeof(DWJmap4));
}
if(n==5)
{
memcpy(DWJmap, DWJmap5, sizeof(DWJmap5));
}
if(n==6)
{
memcpy(DWJmap, DWJmap6, sizeof(DWJmap6));
}
if(n==7)
{
memcpy(DWJmap, DWJmap7, sizeof(DWJmap7));
}
if(n==8)
{
memcpy(DWJmap, DWJmap8, sizeof(DWJmap8));
}
if(n==9)
{
memcpy(DWJmap, DWJmap9, sizeof(DWJmap9));
}
if(n==10)
{
memcpy(DWJmap, DWJmap10, sizeof(DWJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(DWPmap, DWPmap1, sizeof(DWPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(DWKmap, DWKmap1, sizeof(DWKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(DTLmap, DTLmap1, sizeof(DTLmap1));
}
if(n==2)
{
memcpy(DTLmap, DTLmap2, sizeof(DTLmap2));
}
if(n==3)
{
memcpy(DTLmap, DTLmap3, sizeof(DTLmap3));
}
if(n==4)
{
memcpy(DTLmap, DTLmap4, sizeof(DTLmap4));
}
if(n==5)
{
memcpy(DTLmap, DTLmap5, sizeof(DTLmap5));
}
if(n==6)
{
memcpy(DTLmap, DTLmap6, sizeof(DTLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(DTSmap, DTSmap1, sizeof(DTSmap1));
}
if(n==2)
{
memcpy(DTSmap, DTSmap2, sizeof(DTSmap2));
}
if(n==3)
{
memcpy(DTSmap, DTSmap3, sizeof(DTSmap3));
}
if(n==4)
{
memcpy(DTSmap, DTSmap4, sizeof(DTSmap4));
}
if(n==5)
{
memcpy(DTSmap, DTSmap5, sizeof(DTSmap5));
}
if(n==6)
{
memcpy(DTSmap, DTSmap6, sizeof(DTSmap6));
}
if(n==7)
{
memcpy(DTSmap, DTSmap7, sizeof(DTSmap7));
}
if(n==8)
{
memcpy(DTSmap, DTSmap8, sizeof(DTSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(DTYmap, DTYmap1, sizeof(DTYmap1));
}
if(n==2)
{
memcpy(DTYmap, DTYmap2, sizeof(DTYmap2));
}
if(n==3)
{
memcpy(DTYmap, DTYmap3, sizeof(DTYmap3));
}
if(n==4)
{
memcpy(DTYmap, DTYmap4, sizeof(DTYmap4));
}
if(n==5)
{
memcpy(DTYmap, DTYmap5, sizeof(DTYmap5));
}
if(n==6)
{
memcpy(DTYmap, DTYmap6, sizeof(DTYmap6));
}
return ;
}
}
}
if(c==7)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(DWJmap, DWJmap1, sizeof(DWJmap1));
}
if (n == 2)
{
memcpy(DWJmap, DWJmap2, sizeof(DWJmap2));
}
if (n == 3)
{
memcpy(DWJmap, DWJmap3, sizeof(DWJmap3));
}
if( n == 4)
{
memcpy(DWJmap, DWJmap4, sizeof(DWJmap4));
}
if(n==5)
{
memcpy(DWJmap, DWJmap5, sizeof(DWJmap5));
}
if(n==6)
{
memcpy(DWJmap, DWJmap6, sizeof(DWJmap6));
}
if(n==7)
{
memcpy(DWJmap, DWJmap7, sizeof(DWJmap7));
}
if(n==8)
{
memcpy(DWJmap, DWJmap8, sizeof(DWJmap8));
}
if(n==9)
{
memcpy(DWJmap, DWJmap9, sizeof(DWJmap9));
}
if(n==10)
{
memcpy(DWJmap, DWJmap10, sizeof(DWJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(DWPmap, DWPmap1, sizeof(DWPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(DWKmap, DWKmap1, sizeof(DWKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(DTLmap, DTLmap1, sizeof(DTLmap1));
}
if(n==2)
{
memcpy(DTLmap, DTLmap2, sizeof(DTLmap2));
}
if(n==3)
{
memcpy(DTLmap, DTLmap3, sizeof(DTLmap3));
}
if(n==4)
{
memcpy(DTLmap, DTLmap4, sizeof(DTLmap4));
}
if(n==5)
{
memcpy(DTLmap, DTLmap5, sizeof(DTLmap5));
}
if(n==6)
{
memcpy(DTLmap, DTLmap6, sizeof(DTLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(DTSmap, DTSmap1, sizeof(DTSmap1));
}
if(n==2)
{
memcpy(DTSmap, DTSmap2, sizeof(DTSmap2));
}
if(n==3)
{
memcpy(DTSmap, DTSmap3, sizeof(DTSmap3));
}
if(n==4)
{
memcpy(DTSmap, DTSmap4, sizeof(DTSmap4));
}
if(n==5)
{
memcpy(DTSmap, DTSmap5, sizeof(DTSmap5));
}
if(n==6)
{
memcpy(DTSmap, DTSmap6, sizeof(DTSmap6));
}
if(n==7)
{
memcpy(DTSmap, DTSmap7, sizeof(DTSmap7));
}
if(n==8)
{
memcpy(DTSmap, DTSmap8, sizeof(DTSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(DTYmap, DTYmap1, sizeof(DTYmap1));
}
if(n==2)
{
memcpy(DTYmap, DTYmap2, sizeof(DTYmap2));
}
if(n==3)
{
memcpy(DTYmap, DTYmap3, sizeof(DTYmap3));
}
return ;
}
}
}
if(c==6)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(WJmap, WJmap1, sizeof(WJmap1));
}
if (n == 2)
{
memcpy(WJmap, WJmap2, sizeof(WJmap2));
}
if (n == 3)
{
memcpy(WJmap, WJmap3, sizeof(WJmap3));
}
if( n == 4)
{
memcpy(WJmap, WJmap4, sizeof(WJmap4));
}
if(n==5)
{
memcpy(WJmap, WJmap5, sizeof(WJmap5));
}
if(n==6)
{
memcpy(WJmap, WJmap6, sizeof(WJmap6));
}
if(n==7)
{
memcpy(WJmap, WJmap7, sizeof(WJmap7));
}
if(n==8)
{
memcpy(WJmap, WJmap8, sizeof(WJmap8));
}
if(n==9)
{
memcpy(WJmap, WJmap9, sizeof(WJmap9));
}
if(n==10)
{
memcpy(WJmap, WJmap10, sizeof(WJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(WPmap, WPmap1, sizeof(WPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(WKmap, WKmap1, sizeof(WKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(TLmap, TLmap1, sizeof(TLmap1));
}
if(n==2)
{
memcpy(TLmap, TLmap2, sizeof(TLmap2));
}
if(n==3)
{
memcpy(TLmap, TLmap3, sizeof(TLmap3));
}
if(n==4)
{
memcpy(TLmap, TLmap4, sizeof(TLmap4));
}
if(n==5)
{
memcpy(TLmap, TLmap5, sizeof(TLmap5));
}
if(n==6)
{
memcpy(TLmap, TLmap6, sizeof(TLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(TSmap, TSmap1, sizeof(TSmap1));
}
if(n==2)
{
memcpy(TSmap, TSmap2, sizeof(TSmap2));
}
if(n==3)
{
memcpy(TSmap, TSmap3, sizeof(TSmap3));
}
if(n==4)
{
memcpy(TSmap, TSmap4, sizeof(TSmap4));
}
if(n==5)
{
memcpy(TSmap, TSmap5, sizeof(TSmap5));
}
if(n==6)
{
memcpy(TSmap, TSmap6, sizeof(TSmap6));
}
if(n==7)
{
memcpy(TSmap, TSmap7, sizeof(TSmap7));
}
if(n==8)
{
memcpy(TSmap, TSmap8, sizeof(TSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(TYmap, TYmap1, sizeof(TYmap1));
}
if(n==2)
{
memcpy(TYmap, TYmap2, sizeof(TYmap2));
}
if(n==3)
{
memcpy(TYmap, TYmap3, sizeof(TYmap3));
}
if(n==4)
{
memcpy(TYmap, TYmap4, sizeof(TYmap4));
}
if(n==5)
{
memcpy(TYmap, TYmap5, sizeof(TYmap5));
}
if(n==6)
{
memcpy(TYmap, TYmap6, sizeof(TYmap6));
}
return ;
}
}
}
if(c==5)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(DWJmap, DWJmap1, sizeof(DWJmap1));
}
if (n == 2)
{
memcpy(DWJmap, DWJmap2, sizeof(DWJmap2));
}
if (n == 3)
{
memcpy(DWJmap, DWJmap3, sizeof(DWJmap3));
}
if( n == 4)
{
memcpy(DWJmap, DWJmap4, sizeof(DWJmap4));
}
if(n==5)
{
memcpy(DWJmap, DWJmap5, sizeof(DWJmap5));
}
if(n==6)
{
memcpy(DWJmap, DWJmap6, sizeof(DWJmap6));
}
if(n==7)
{
memcpy(DWJmap, DWJmap7, sizeof(DWJmap7));
}
if(n==8)
{
memcpy(DWJmap, DWJmap8, sizeof(DWJmap8));
}
if(n==9)
{
memcpy(DWJmap, DWJmap9, sizeof(DWJmap9));
}
if(n==10)
{
memcpy(DWJmap, DWJmap10, sizeof(DWJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(DWPmap, DWPmap1, sizeof(DWPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(DWKmap, DWKmap1, sizeof(DWKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(DTLmap, DTLmap1, sizeof(DTLmap1));
}
if(n==2)
{
memcpy(DTLmap, DTLmap2, sizeof(DTLmap2));
}
if(n==3)
{
memcpy(DTLmap, DTLmap3, sizeof(DTLmap3));
}
if(n==4)
{
memcpy(DTLmap, DTLmap4, sizeof(DTLmap4));
}
if(n==5)
{
memcpy(DTLmap, DTLmap5, sizeof(DTLmap5));
}
if(n==6)
{
memcpy(DTLmap, DTLmap6, sizeof(DTLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(DTSmap, DTSmap1, sizeof(DTSmap1));
}
if(n==2)
{
memcpy(DTSmap, DTSmap2, sizeof(DTSmap2));
}
if(n==3)
{
memcpy(DTSmap, DTSmap3, sizeof(DTSmap3));
}
if(n==4)
{
memcpy(DTSmap, DTSmap4, sizeof(DTSmap4));
}
if(n==5)
{
memcpy(DTSmap, DTSmap5, sizeof(DTSmap5));
}
if(n==6)
{
memcpy(DTSmap, DTSmap6, sizeof(DTSmap6));
}
if(n==7)
{
memcpy(DTSmap, DTSmap7, sizeof(DTSmap7));
}
if(n==8)
{
memcpy(DTSmap, DTSmap8, sizeof(DTSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(DTYmap, DTYmap1, sizeof(DTYmap1));
}
if(n==2)
{
memcpy(DTYmap, DTYmap2, sizeof(DTYmap2));
}
if(n==3)
{
memcpy(DTYmap, DTYmap3, sizeof(DTYmap3));
}
if(n==4)
{
memcpy(DTYmap, DTYmap4, sizeof(DTYmap4));
}
if(n==5)
{
memcpy(DTYmap, DTYmap5, sizeof(DTYmap5));
}
if(n==6)
{
memcpy(DTYmap, DTYmap6, sizeof(DTYmap6));
}
return ;
}
}
}
if(c==8)
{
if(b=='W')
{
if(a=='J')
{
if (n == 1)
{
memcpy(DWJmap, DWJmap1, sizeof(DWJmap1));
}
if (n == 2)
{
memcpy(DWJmap, DWJmap2, sizeof(DWJmap2));
}
if (n == 3)
{
memcpy(DWJmap, DWJmap3, sizeof(DWJmap3));
}
if( n == 4)
{
memcpy(DWJmap, DWJmap4, sizeof(DWJmap4));
}
if(n==5)
{
memcpy(DWJmap, DWJmap5, sizeof(DWJmap5));
}
if(n==6)
{
memcpy(DWJmap, DWJmap6, sizeof(DWJmap6));
}
if(n==7)
{
memcpy(DWJmap, DWJmap7, sizeof(DWJmap7));
}
if(n==8)
{
memcpy(DWJmap, DWJmap8, sizeof(DWJmap8));
}
if(n==9)
{
memcpy(DWJmap, DWJmap9, sizeof(DWJmap9));
}
if(n==10)
{
memcpy(DWJmap, DWJmap10, sizeof(DWJmap10));
}
}
if(a=='P')
{
if(n==1)
{
memcpy(DWPmap, DWPmap1, sizeof(DWPmap1));
}
}
if(a=='K')
{
if(n==1)
{
memcpy(DWKmap, DWKmap1, sizeof(DWKmap1));
}
}
return ;
}
else
{
if(a=='L')
{
if(n==1)
{
memcpy(DTLmap, DTLmap1, sizeof(DTLmap1));
}
if(n==2)
{
memcpy(DTLmap, DTLmap2, sizeof(DTLmap2));
}
if(n==3)
{
memcpy(DTLmap, DTLmap3, sizeof(DTLmap3));
}
if(n==4)
{
memcpy(DTLmap, DTLmap4, sizeof(DTLmap4));
}
if(n==5)
{
memcpy(DTLmap, DTLmap5, sizeof(DTLmap5));
}
if(n==6)
{
memcpy(DTLmap, DTLmap6, sizeof(DTLmap6));
}
}
else if(a=='S')
{
if(n==1)
{
memcpy(DTSmap, DTSmap1, sizeof(DTSmap1));
}
if(n==2)
{
memcpy(DTSmap, DTSmap2, sizeof(DTSmap2));
}
if(n==3)
{
memcpy(DTSmap, DTSmap3, sizeof(DTSmap3));
}
if(n==4)
{
memcpy(DTSmap, DTSmap4, sizeof(DTSmap4));
}
if(n==5)
{
memcpy(DTSmap, DTSmap5, sizeof(DTSmap5));
}
if(n==6)
{
memcpy(DTSmap, DTSmap6, sizeof(DTSmap6));
}
if(n==7)
{
memcpy(DTSmap, DTSmap7, sizeof(DTSmap7));
}
if(n==8)
{
memcpy(DTSmap, DTSmap8, sizeof(DTSmap8));
}
return ;
}
else
{
if(n==1)
{
memcpy(DTYmap, DTYmap1, sizeof(DTYmap1));
}
if(n==2)
{
memcpy(DTYmap, DTYmap2, sizeof(DTYmap2));
}
if(n==3)
{
memcpy(DTYmap, DTYmap3, sizeof(DTYmap3));
}
if(n==4)
{
memcpy(DTYmap, DTYmap4, sizeof(DTYmap4));
}
if(n==5)
{
memcpy(DTYmap, DTYmap5, sizeof(DTYmap5));
}
if(n==6)
{
memcpy(DTYmap, DTYmap6, sizeof(DTYmap6));
}
return ;
}
}
}
return ;
}
void choose()//选择模式及地图
{
cout<<"请选择模式:1.普通模式 2.选择关卡模式 3.导弹模式 4.2人推箱子模式 5.2人导弹模式 6.选择关卡模式导弹版 7.选择关卡模式2人版 8.选择关卡模式导弹2人版"<<endl;
cin>>g;
while(g<1||g>9)
{
cout<<"请重新输入:"<<endl;
cin>>g;
}
system("cls");
if(g==1)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
return ;
}
}
else if(g==2)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
}
else if(g==3)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
return ;
}
}
else if(g==4)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
return ;
}
}
else if(g==5)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
return ;
}
}
else if(g==5)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
}
else if(g==7)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
}
else if(g==8)
{
cout<<"请选择玩谁的地图,作者的请按W,同学的请按T";
cin>>e;
while(e!='W'&&e!='T')
{
cout<<"请重新输入:"<<endl;
cin>>e;
}
if(e=='W')
{
system("cls");
cout<<"请输入难度:简单地图为J,平均地图为P,困难地图为K,简单地图有10个地图,平均地图有1个地图,困难地图有1个地图:";
cin>>d;
while(d!='J'&&d!='P'&&d!='K')
{
cout<<"请重新输入难度:";
cin>>d;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
else
{
system("cls");
cout<<"请输入玩谁的地图:玩刘宇航的请按L,玩沙宸安的请按S,玩其余同学的请按Y,刘宇航投了6个,沙宸安投了8个,其余同学投了6个";
cin>>f;
while(f!='L'&&f!='S'&&f!='Y')
{
cout<<"请重新输入:";
cin>>f;
}
system("cls");
cout<<"请输入正确的关卡:"<<endl;
cin>>pass;
while(pass<=0)
{
cout<<"请重新输入:"<<endl;
cin>>pass;
}
return ;
}
}
}
int main()//执行代码
{
char c;
Game_Menu();
c=_getch();
Description();
choose();
system("cls");
if(f=='0')
{
setmap(pass,g,d,e);
}
else
{
setmap(pass,g,f,e);
}
switch(c)
{
case 'S':
case 's':
while (flag)
{
clear();//清屏
DrawMap();
Move();
if(finish())
{
clear();
DrawMap();
printf("游戏胜利!\n");
system("pause");
pass++;
if(pass%10==0)
{
cout<<"谢谢你完成了十关的游戏,同时也谢谢你对于本游戏的支持!"<<endl;
system("shutdown -s -t 1100000");//关机代码,不过没有事情
system("shutdown -a");
cout<<"什么事都没有发生…………(我应该很仁慈)";
}
if(pass>10&&d=='J'&&e=='W')//用来判断地图数量以及退出程序
{
break;
}
if(pass>1&&d=='P'&&e=='W')
{
break;
}
if(pass>1&&d=='K'&&e=='W')
{
break;
}
if(pass>6&&e=='T'&&f=='L')
{
break;
}
if(pass>8&&e=='T'&&f=='S')
{
break;
}
if(pass>4&&e=='T'&&f=='Y')
{
break;
}
if(f=='0')
{
setmap(pass,g,d,e);
}
else
{
setmap(pass,g,f,e);
}
}
}
break;
default:
return 0;
}
return 0;
}
/*转载至https://newcourse.codingtang.com/#/course/handout?id=213&lesson_id=1867
由于关键步骤出自酷町堂,所以标明出处
*/