include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
long long tu[50][105],x,y,jishu,jumph,ge,siwang,ew;
int xx,yy,juli;
string po,wq,we,yige,ditudaima;
bool jump,o,chu,z1,zhengfan;
void gotoxy(int x, int y)
{
HANDLE hout;
COORD coord;
coord.X = x;
coord.Y = y;
hout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hout, coord);
}
void hseanshu(){
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);//获取控制台光标信息
CursorInfo.bVisible = false; //隐藏控制台光标
SetConsoleCursorInfo(handle, &CursorInfo);//设置控制台光标状态
//隐藏光标
}
int main()
{
hseanshu();
o=0;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),3);
while(1){
memset(tu,0,sizeof(tu));
gotoxy(0,0);
if(!o)cout<<”欢迎来到跑酷大陆,请输入(1:随机关卡,2:每日一练,3:创造模式,4:打开地图)(末尾加换行):\n”;
else {
gotoxy(0,0);
cout<<” \n “;
gotoxy(0,0);
cout<<”菜单界面: 请输入(1:随机关卡,2:每日一练,3:创造模式,4:打开地图)(末尾加换行):\n”;
}
while(1){
cin>>wq;
if(wq==”1”||wq==”2”||wq==”3”||wq==”4”)break;
gotoxy(0,0);
cout<<” “;
gotoxy(0,0);
cout<<”输入错误:\n”;
}
gotoxy(0,0);
cout<<” \n”;
cout<<” \n”;
cout<<” “;
gotoxy(0,0);
if(wq!=”3”){
cout<<”请输入速度(数字越小速度越快)(输入1或2)(末尾加换行):\n”;
while(1){
cin>>we;
if(we==”1”||we==”2”)break;
gotoxy(0,0);
cout<<” “;
gotoxy(0,0);
cout<<”输入错误:\n”;
}
if(we==”1”)ew=5;
else if(we==”2”)ew=9;
gotoxy(0,0);
cout<<” “;
}
if(wq==”3”){
cout<<”请输入地图方式(1:空白地图,2:载入地图):\n”;
while(1){
cin>>we;
if(we==”1”||we==”2”)break;
gotoxy(0,0);
cout<<” “;
gotoxy(0,0);
cout<<”输入错误:\n”;
}
gotoxy(0,0);
cout<<” “;
if(we==”2”){
gotoxy(0,0);
cout<<” \n”;
cout<<” “;
gotoxy(0,0);
cout<<”请输入地图代码:\n”;
while(1){
cin>>ditudaima;
bool hedui=1;
int jianqu=ditudaima[0]-48;
if(ditudaima.size()>=3500){
for(int g=1;g[HTML_REMOVED]‘9’){
hedui=0;
break;
}
}
}
else hedui=0;
if(hedui){
hseanshu();
gotoxy(0,0);
for(int g=1;g<=2000;g){
cout<<” “;
}
x=1;
y=0;
for(int g=1;g[HTML_REMOVED]>yige;
bool hedui=1;
int jianqu=yige[0]-48;
if(yige.size()>=3500){
for(int g=1;g[HTML_REMOVED]‘9’){
hedui=0;
break;
}
}
}
else hedui=0;
if(hedui){
hseanshu();
gotoxy(0,0);
for(int g=1;g<=2000;g){
cout<<” “;
}
break;
}
else {
gotoxy(0,0);
for(int g=1;g<=2000;g){
cout<<” “;
}
gotoxy(0,0);
cout<<”输入错误:\n” ;
Sleep(1000);
}
}
}
if(wq==”1”){
srand(time(0));
ge=1;
while(1){
xx=2;
yy=1;
memset(tu,0,sizeof(tu));
x=1,y=1;
tu[1][1]=1;
while(x<41&&y<101){
int t=rand()%5;
if(x+3-t>=1&&x+3-t<=30){
tu[x+3-t][y+t]=1;
x+=3-t;
y+=t;
}
}
tu[x][101]=3;
siwang=0;
juli=1;
while(1){
hseanshu();
juli=max(juli,yy);
if(xx<=0){
tu[xx][yy]=0;
xx=2,yy=1;
siwang;
}
else if(tu[xx-1][yy]==3){
ge;
break;
}
jishu;
if(jishu==ew){
if(jump){
if(jumph<=2){
if(tu[xx+1][yy]==0){
tu[xx][yy]=0;
xx;
}
jumph;
}
else jump=0;
}
else if(tu[xx-1][yy]==0){
tu[xx][yy]=0;
xx–;
}
jishu=0;
}
if(kbhit()){
po=getch();
if(po==”w”){
if(tu[xx-1][yy]==1){
tu[xx][yy]=0;
jump=1;
jumph=0;
}
}
else if(po==”a”){
tu[xx][yy]=0;
if(yy-1>=1&&tu[xx][yy-1]==0)yy–;
}
else if(po==”d”){
tu[xx][yy]=0;
if(yy+1<=101&&tu[xx][yy+1]==0)yy;
}
else if(po==”s”){
tu[xx][yy]=0;
if(xx-1>=1&&tu[xx-1][yy]==0)xx–;
}
else if(po==”b”){
chu=1;
break;
}
po=”“;
}
tu[xx][yy]=2;
gotoxy(0,0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
if(xx<=7){
if(yy<=11){
for(int g=15;g>=1;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=15;g>=1;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=15;g>=1;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(xx>=34){
if(yy<=11){
for(int g=41;g>=27;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=41;g>=27;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=41;g>=27;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(yy<=11){
for(int g=xx+7;g>=xx-7;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=xx+7;g>=xx-7;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=xx+7;g>=xx-7;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),3);
cout<<”关卡:”<[HTML_REMOVED]=1&&x+3-t<=30){
tu[x+3-t][y+t]=1;
x+=3-t;
y+=t;
}
}
tu[x][101]=3;
siwang=0;
juli=1;
while(1){
hseanshu();
juli=max(juli,yy);
if(xx<=0){
tu[xx][yy]=0;
xx=2,yy=1;
siwang;
}
else if(tu[xx-1][yy]==3){
ge;
break;
}
jishu;
if(jishu==ew){
if(jump){
if(jumph<=2){
if(tu[xx+1][yy]==0){
tu[xx][yy]=0;
xx;
}
jumph;
}
else jump=0;
}
else if(tu[xx-1][yy]==0){
tu[xx][yy]=0;
xx–;
}
jishu=0;
}
if(kbhit()){
po=getch();
if(po==”w”){
if(tu[xx-1][yy]==1){
tu[xx][yy]=0;
jump=1;
jumph=0;
}
}
else if(po==”a”){
tu[xx][yy]=0;
if(yy-1>=1&&tu[xx][yy-1]==0)yy–;
}
else if(po==”d”){
tu[xx][yy]=0;
if(yy+1<=101&&tu[xx][yy+1]==0)yy;
}
else if(po==”s”){
tu[xx][yy]=0;
if(xx-1>=1&&tu[xx-1][yy]==0)xx–;
}
else if(po==”b”){
chu=1;
break;
}
po=”“;
}
tu[xx][yy]=2;
gotoxy(0,0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
if(xx<=7){
if(yy<=11){
for(int g=15;g>=1;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=15;g>=1;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=15;g>=1;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(xx>=34){
if(yy<=11){
for(int g=41;g>=27;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=41;g>=27;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=41;g>=27;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(yy<=11){
for(int g=xx+7;g>=xx-7;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=xx+7;g>=xx-7;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=xx+7;g>=xx-7;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),3);
cout<<”关卡:”<[HTML_REMOVED]=11){
cout<<”今日挑战(十关)已全部通关,请明天再试(等待5秒后返回菜单)!”;
o=1;
for(int g=1;g<=100;g){
if(kbhit()){
po=getch();
}
}
Sleep(5000);
break;
}
else{
cout<<”新地图准备就绪: \n”;
for(int g=1;g<=100;g){
if(kbhit()){
po=getch();
}
}
Sleep(900);
gotoxy(0,0);
cout<<”正在打开: \n”;
for(int g=1;g<=1000;g){
if(kbhit()){
po=getch();
}
}
Sleep(500);
}
}
}
else if(wq==”3”){
if(we==”1”)memset(tu,0,sizeof(tu));
gotoxy(0,0);
cout<<” “;
gotoxy(0,0);
cout<<”正在加载地图…\n”;
Sleep(1000);
gotoxy(0,0);
cout<<”正在打开… \n”;
Sleep(500);
gotoxy(0,0);
cout<<”“1”放普通方块,“2”放终点,“3”左箭头,“4”右箭头,“c”清除\n”;
Sleep(2000);
xx=2;
yy=1;
x=1,y=1;
tu[1][1]=1;
gotoxy(0,0);
cout<<” \n”;
gotoxy(0,0);
while(1){
hseanshu();
if(kbhit()){
po=getch();
if(po==”w”){
if(tu[xx+1][yy]==0&&xx+1<=41){
tu[xx][yy]=0;
xx;
tu[xx][yy]=1;
}
}
else if(po==”a”){
tu[xx][yy]=0;
if(yy-1>=1&&tu[xx][yy-1]==0)yy–;
}
else if(po==”d”){
tu[xx][yy]=0;
if(yy+1<=101&&tu[xx][yy+1]==0)yy;
}
else if(po==”s”){
tu[xx][yy]=0;
if(xx-1>=1&&tu[xx-1][yy]==0)xx–;
}
else if(po==”p”){//保存
gotoxy(0,0);
for(int g=1;g<=20;g){
cout<<” “;
}
gotoxy(0,0);
if(z1){
srand(time(0));
int qu=rand()%5;
cout<[HTML_REMOVED]=1){
if(xx-1!=1||yy!=1){
if(tu[xx-1][yy]==3){
z1=0;
}
tu[xx-1][yy]=1;
}
}
}
else if(po==”c”){
if(xx-1>=1){
if(xx-1!=1||yy!=1){
if(tu[xx-1][yy]==3){
z1=0;
}
tu[xx-1][yy]=0;
}
}
}
else if(po==”2”){
if(xx-1>=1){
if(xx-1!=1||yy!=1){
z1=1;
tu[xx-1][yy]=3;
}
}
}
else if(po==”3”){
if(xx-1>=1){
if(xx-1!=1||yy!=1){
if(tu[xx-1][yy]==3){
z1=0;
}
tu[xx-1][yy]=4;
}
}
}
else if(po==”4”){
if(xx-1>=1){
if(xx-1!=1||yy!=1){
if(tu[xx-1][yy]==3){
z1=0;
}
tu[xx-1][yy]=5;
}
}
}
po=”“;
}
tu[xx][yy]=2;
gotoxy(0,0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
if(xx<=7){
if(yy<=11){
for(int g=15;g>=1;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=15;g>=1;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=15;g>=1;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(xx>=34){
if(yy<=11){
for(int g=41;g>=27;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=41;g>=27;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=41;g>=27;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(yy<=11){
for(int g=xx+7;g>=xx-7;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=xx+7;g>=xx-7;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=xx+7;g>=xx-7;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),3);
cout<<”位置:”<[HTML_REMOVED]=1&&tu[xx][yy-1]==0)yy–;
}
else if(po==”d”){
tu[xx][yy]=0;
if(yy+1<=101&&tu[xx][yy+1]==0)yy;
}
else if(po==”s”){
tu[xx][yy]=0;
if(xx-1>=1&&tu[xx-1][yy]==0)xx–;
}
else if(po==”b”){
chu=1;
break;
}
po=”“;
}
tu[xx][yy]=2;
gotoxy(0,0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
if(xx<=7){
if(yy<=11){
for(int g=15;g>=1;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=15;g>=1;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=15;g>=1;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(xx>=34){
if(yy<=11){
for(int g=41;g>=27;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=41;g>=27;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=41;g>=27;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
}
else if(yy<=11){
for(int g=xx+7;g>=xx-7;g–){
for(int h=1;h<=23;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else if(yy>90){
for(int g=xx+7;g>=xx-7;g–){
for(int h=79;h<=101;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
else {
for(int g=xx+7;g>=xx-7;g–){
for(int h=yy-11;h<=yy+11;h){
if(tu[g][h]==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),22);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),26);
cout << “●”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “■”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “←”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else if(tu[g][h]==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),27);
cout << “→”;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),17);
}
else{
cout<<” “;
}
}
cout<<”\n”;
}
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),3);
cout<<”关卡:”<<ge<<” “<<”位置:”<<xx<<” “<<yy<<” 死亡数:”<<siwang<<” 按“b”跳出 \n”;
}
gotoxy(0,0);
if(chu){
cout<<”正在跳出...... “;
for(int g=1;g<=15;g){
for(int h=1;h<=46;h){
cout<<” “;
Sleep(7);
}
cout<<”\n”;
}
for(int h=1;h<=60;h){
cout<<” “;
Sleep(7);
}
cout<<”\n”;
for(int h=1;h<=60;h){
cout<<” “;
Sleep(7);
}
cout<<”\n”;
chu=0;
o=1;
break;
}
cout<<”恭喜通关,快去告诉关卡的作者吧(3秒钟后关闭)! \n”;
for(int g=1;g<=15;g){
for(int h=1;h<=46;h){
cout<<” “;
Sleep(7);
}
cout<<”\n”;
}
for(int h=1;h<=60;h++){
cout<<” “;
Sleep(7);
}
cout<<”\n”;
}
}
}
您堪称肝帝!太牛了!但我有个问题,您没用代码框,所以这代码显示出来有点变形,还有些地方变成了“HTML_REMOVED”,能修复吗?否则这个代码拷到编译器里运行不了
大佬膜拜!