高级光能
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<conio.h>
#include<Windows.h>
using namespace std;
int main()
{
HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
system("color 04");
int x=8,y=31;
char ch;
int a[11][36]{{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,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0},
{1,1,1,1,1,1,1,1,1,8,1,1,1,1,1,1,1,1,1,1,0,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
while(1)
{
for(int i=0;i<=10;i++)
{
for(int j=0;j<=35;j++)
{
if(a[i][j]==1)
{SetConsoleTextAttribute(hstdout, 0x0C);
cout<<"OT";
}
else if(a[i][j]==2)
{
cout<<"HH";
}
else if(a[i][j]==3)
{
cout<<"N ";
}
else if(a[i][j]==0)
{
cout<<" ";
}
else if(a[i][j]==9)
{
SetConsoleTextAttribute(hstdout, 0x0E);
cout<<"GD";
}
else if(a[i][j]==8)
{ SetConsoleTextAttribute(hstdout, 0x0F);
cout<<"MM";
}
}
cout<<endl;
}
ch=getch();
if(ch=='a')
{
if(a[x+1][y-1]==8)
{
system("cls");
system("color 0F");
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y-1]==0&&a[x+1][y]!=1)
{
a[x+1][y-1]=9;
a[x][y]=0;
x++;
y--;
system("cls");
}
else if(a[x][y-1]==1&&a[x-1][y-1]!=1)
{
a[x-1][y-1]=9;
a[x][y]=0;
x--;
y--;
system("cls");
}
else
{
a[x][y-1]=9;
a[x][y]=0;
y--;
system("cls");
}
}
else if(ch=='z'&&a[x-1][y]!=1)
{
a[x][y]=1;
a[x-1][y]=9;
x-=1;
system("cls");
}
else if(ch=='d')
{
if(a[x+1][y+1]==8)
{
system("cls");
system("color 0F") ;
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y+1]==0&&a[x-1][y+1]!=1)
{
a[x+1][y+1]=9;
a[x][y]=0;
x++;
y++;
system("cls");
}
else if(a[x][y+1]==1)
{
a[x-1][y+1]=9;
a[x][y]=0;
x--;
y++;
system("cls");
}
else
{
a[x][y+1]=9;
a[x][y]=0;
y++;
system("cls");
}
}
else
{
system("cls");
}
}
return 0;
}
江齐悦在2020-05-23 17:03:44追加了内容
这是王子逸大神的作品
中级天翼
梁俊杰,我是你同学,我过会给你
邓涵睿在2020-05-23 17:02:41追加了内容
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,a,b,c,d,e,f,g,h,i,j,k,l,sum;
cout<<"欢迎来到恋爱指数测试器*>-<*"<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
cout<<"独家的哦*^0^*"<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
cout<<"以下异性均为合适年龄"<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
cout<<"下列问题如果是则输入2,如果不是则输入1,一点也没感觉输入0"<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
cout<<"加油,面对你自己!*-o-*"<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
cout<<"question one:"<<"你是否面对异性时有莫名心跳?"<<endl;
cin>>n;
cout<<endl;
cout<<"question two:"<<"你是否有看到异性被撩时很愤怒?"<<endl;
cin>>m;
cout<<endl;
cout<<"question three:"<<"你是否惧怕见到一位异性的家长"<<endl;
cin>>a;
cout<<endl;
cout<<"question four:"<<"你是否经常刷一位异性的QQ或其他软件"<<endl;
cin>>b;
cout<<endl;
cout<<"question five:"<<"想不想真心和Ta用情头?"<<endl;
cin>>c;
cout<<endl;
cout<<"question six:"<<"和Ta邂逅过吗?"<<endl;
cin>>d;
cout<<endl;
cout<<"question seven:"<<"吃过同一个饭碗里的东西吗?"<<endl;
cin>>e;
cout<<endl;
cout<<"question eight:"<<"有过一个人在梦里与Ta相遇吗?"<<endl;
cin>>f;
cout<<endl;
cout<<"question nine:"<<"有为了等Ta一个人站在风雨中吗?"<<endl;
cin>>g;
cout<<endl;
cout<<"question ten:"<<"想kissTa不,想摸Ta的头发吗?"<<endl;
cin>>h;
cout<<endl;
sum=n+m+a+b+c+d+e+f+g+h;
cout<<"正在测评中,请稍后..."<<endl;
for(int i=1;i<=1000000000;i++)
l=i;
if(sum>=16&&sum<=20)
cout<<"你的恋爱指数为:A。你是一个深深爱着Ta的人,你往往会走到最后^-^。"<<endl;
if(sum<=15&&sum>=12)
cout<<"你的恋爱指数为:B。你是一个矛盾却又不失爱意的人,你的爱往往一波三折!-!。"<<endl;
if(sum<=11&&sum>=7)
cout<<"你的恋爱指数为:C。你是一个有点点情丝的人,你想表,却又惧怕现实,你仍须努力o-o。"<<endl;
if(sum<=6&&sum>=0)
cout<<"你的恋爱指数为:D。你是一个无暇无垢,不食人间烟火的人,想一路踏歌,证道路上需佳人陪伴+-+。"<<endl;
if(sum>20||sum<0)
cout<<"你出格了哟ooo.ooo"<<endl;
cout<<"人生在世,恍如昨世,孤独的身影终难走远,你的那个Ta就在不远方,就如漫天繁星,总有一颗属于你!"<<endl;\
cout<<"快抓紧你身边的那个Ta^-^oooooo"<<endl;
cout<<endl;
cout<<"作品创造者:yang sky one"<<endl;
cout<<"恋爱指数测试器已关闭,需重启………………"<<endl;
return 0;
}
高级光能
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<conio.h>
#include<Windows.h>
using namespace std;
int main()
{
HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
system("color 04");
int x=8,y=31;
char ch;
int a[11][36]{{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,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0},
{1,1,1,1,1,1,1,1,1,8,1,1,1,1,1,1,1,1,1,1,0,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
while(1)
{
for(int i=0;i<=10;i++)
{
for(int j=0;j<=35;j++)
{
if(a[i][j]==1)
{SetConsoleTextAttribute(hstdout, 0x0C);
cout<<"OT";
}
else if(a[i][j]==2)
{
cout<<"HH";
}
else if(a[i][j]==3)
{
cout<<"N ";
}
else if(a[i][j]==0)
{
cout<<" ";
}
else if(a[i][j]==9)
{
SetConsoleTextAttribute(hstdout, 0x0E);
cout<<"GD";
}
else if(a[i][j]==8)
{ SetConsoleTextAttribute(hstdout, 0x0F);
cout<<"MM";
}
}
cout<<endl;
}
ch=getch();
if(ch=='a')
{
if(a[x+1][y-1]==8)
{
system("cls");
system("color 0F");
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y-1]==0&&a[x+1][y]!=1)
{
a[x+1][y-1]=9;
a[x][y]=0;
x++;
y--;
system("cls");
}
else if(a[x][y-1]==1&&a[x-1][y-1]!=1)
{
a[x-1][y-1]=9;
a[x][y]=0;
x--;
y--;
system("cls");
}
else
{
a[x][y-1]=9;
a[x][y]=0;
y--;
system("cls");
}
}
else if(ch=='z'&&a[x-1][y]!=1)
{
a[x][y]=1;
a[x-1][y]=9;
x-=1;
system("cls");
}
else if(ch=='d')
{
if(a[x+1][y+1]==8)
{
system("cls");
system("color 0F") ;
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y+1]==0&&a[x-1][y+1]!=1)
{
a[x+1][y+1]=9;
a[x][y]=0;
x++;
y++;
system("cls");
}
else if(a[x][y+1]==1)
{
a[x-1][y+1]=9;
a[x][y]=0;
x--;
y++;
system("cls");
}
else
{
a[x][y+1]=9;
a[x][y]=0;
y++;
system("cls");
}
}
else if(ch=='w'&&a[x-1][y]!=1&&(a[x][y+1]||a[x][y-1]==1))
{
a[x-1][y]=9;
a[x][y]=0;
x--;
system("cls");
}
else if(ch=='s'&&a[x+1][y]!=1&&(a[x][y+1]||a[x][y-1]==1))
{
a[x+1][y]=9;
a[x][y]=0;
x++;
system("cls");
}
else
{
system("cls");
}
}
return 0;
}
这是王子逸大神的作品
更新过的呦
我试了,特别好玩
新手天翼
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<conio.h>
#include<Windows.h>
using namespace std;
int main()
{
HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
system("color 04");
int x=8,y=31;
char ch;
int a[11][36]{{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,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0},
{1,1,1,1,1,1,1,1,1,8,1,1,1,1,1,1,1,1,1,1,0,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
while(1)
{
for(int i=0;i<=10;i++)
{
for(int j=0;j<=35;j++)
{
if(a[i][j]==1)
{SetConsoleTextAttribute(hstdout, 0x0C);
cout<<"OT";
}
else if(a[i][j]==2)
{
cout<<"HH";
}
else if(a[i][j]==3)
{
cout<<"N ";
}
else if(a[i][j]==0)
{
cout<<" ";
}
else if(a[i][j]==9)
{
SetConsoleTextAttribute(hstdout, 0x0E);
cout<<"GD";
}
else if(a[i][j]==8)
{ SetConsoleTextAttribute(hstdout, 0x0F);
cout<<"MM";
}
}
cout<<endl;
}
ch=getch();
if(ch=='a')
{
if(a[x+1][y-1]==8)
{
system("cls");
system("color 0F");
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y-1]==0&&a[x+1][y]!=1)
{
a[x+1][y-1]=9;
a[x][y]=0;
x++;
y--;
system("cls");
}
else if(a[x][y-1]==1&&a[x-1][y-1]!=1)
{
a[x-1][y-1]=9;
a[x][y]=0;
x--;
y--;
system("cls");
}
else
{
a[x][y-1]=9;
a[x][y]=0;
y--;
system("cls");
}
}
else if(ch=='z'&&a[x-1][y]!=1)
{
a[x][y]=1;
a[x-1][y]=9;
x-=1;
system("cls");
}
else if(ch=='d')
{
if(a[x+1][y+1]==8)
{
system("cls");
system("color 0F") ;
cout<<"\n\n\n\n\t\t\t\t\tGame Over!\n\n\n\n\n\n\n";
Sleep(5000);
return 0;
}
else if(a[x+1][y+1]==0&&a[x-1][y+1]!=1)
{
a[x+1][y+1]=9;
a[x][y]=0;
x++;
y++;
system("cls");
}
else if(a[x][y+1]==1)
{
a[x-1][y+1]=9;
a[x][y]=0;
x--;
y++;
system("cls");
}
else
{
a[x][y+1]=9;
a[x][y]=0;
y++;
system("cls");
}
}
else if(ch=='w'&&a[x-1][y]!=1&&(a[x][y+1]||a[x][y-1]==1))
{
a[x-1][y]=9;
a[x][y]=0;
x--;
system("cls");
}
else if(ch=='s'&&a[x+1][y]!=1&&(a[x][y+1]||a[x][y-1]==1))
{
a[x+1][y]=9;
a[x][y]=0;
x++;
system("cls");
}
else
{
system("cls");
}
}
return 0;
}
原创给你发过来了
a,b移动,w爬墙,s下墙