提交 fb3751a0 编写于 作者: 道标 · 年's avatar 道标 · 年 🙂

Update 艹.cpp

上级 8e2f4e07
/*
关于所有函数的解释
main12:主界面
main: 一开始进入的主界面
board: 一些选项
其它的可以百度一下,都是英文(有些是拼音)
有重要的变量
option:通用选择
游戏说明:
此游戏包含很多玩法
有迷宫,技能,等级制,战斗等等
可以自由去探索
*/
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <conio.h>
using namespace std;
void ten()
{
int main12();
void start();
void board();
void maps();
void bag();//bug 可以先看一下,不知道出了什么问题
void box();
void equips();//装备 未完成
void skill_board();//技能板 未完成
void lingdong();
void zhanchang();//未完成
void shenming();
void huo();
void bin();//未完成
void jin();//未完成
void shu();//未完成
void lu();//未完成
void equip_bag();//未完成
int shanghai(double gong);
int jianshang(double fang);
int boss_shanghai(double gong);
void pretreatment();
void ten();
void eleven();
void twelve();
void thirteen();
void fourteen();
void fifteen();
const int N=1e3+10;
struct op{
string name;
string lei;
string fangyu;
string gongji;
}equip_attributes[N];
struct xh{
int cnn;
string bag;
}bags[N];
struct xu{
int cnn;
string boxx;
}boxs[N];
bool jineng[100];
int grade=1;
int blood[101]={0,100};
int experience[101];
string name;
int option,attribute,flag_box[N],flag_bag[N],exits,savage,times,attack=1,defense=1;
int jinyan;
int baoji=5;
int sum_level[101]={};
bool ops[N];
string head,body,trousers,shoes;
int main(){
start();
pretreatment();
cout<<endl<<"请输入你所要的属性"<<endl;
cout<<"1.金 2.木 3.水 4.火 5.土";
cin>>attribute;
board();
cin>>option;
if(option==1){
maps();
if(exits==1){
return 0;
}
main12();
}else if(option==2){
bag();
main12();
}else if(option==3){
box();
main12();
}else if(option==4){
equips();
main12();
}else if(option==5){
skill_board();
main12();
}
}
void start(){
cout<<"Welcome to AXX";
cout<<endl;
cout<<"Please wait a moment"<<endl;
Sleep(1000);
cout<<"请输入你的名字"<<endl;
cin>>name;
}
void pretreatment(){
int num=1;
for(int i=100;i<=10000;i+=100){
blood[num]=i;
experience[num]=i;
num++;
}
for(int i=1;i<=100;i++){
bags[i-1].cnn=i;
}
}
void board(){
cout<<endl<<endl<<endl;
cout<<"姓名:"<<name<<endl;
cout<<"境界"<<endl; //暂不开放
cout<<"等级:"<<grade<<endl;
cout<<"血量:"<<blood[grade]<<endl;
cout<<"属性:";
if(attribute==1){
cout<<"金"<<endl;
}else if(attribute==2){
cout<<"木"<<endl;
}else if(attribute==3){
cout<<"水"<<endl;
}else if(attribute==4){
cout<<"火"<<endl;
}else {
cout<<"土"<<endl;
}
cout<<"攻击:"<<attack<<endl;
cout<<"防御:"<<defense<<endl;
Sleep(1000);
cout<<"1.地图 "<<"2.背包 "<<"3.精灵箱 "<<"4.装备 "<<"5.技能板 "<<endl;
}
void maps(){
cout<<"1.灵洞 "<<"2.战场 "<<"3.生命之树 "<<"4.流火之地 "<<"5.深海之地 "<<endl;
cout<<"6.铁金山 "<<"7.恶魔树林 "<<"8.阿努比斯的大陆沙漠 "<<"9.退出";
cin>>option;
if(option==1){
lingdong();
main12();
}else if(option==2){
zhanchang();
main12();
}else if(option==3){
shenming();
main12();
}else if(option==4){
huo();
main12();
}else if(option==5){
bin();
main12();
}else if(option==6){
jin();
main12();
}else if(option==7){
shu();
main12();
}else if(option==8){
lu();
main12();
}else{
exits=1;
}
}
void bag(){ //bug
int sum=0;
for(int i=0;i<=20;i++){
for(int j=0;j<5;j++){
if(!flag_bag[i])
cout<<bags[i].cnn<<":"<<bags[i].bag[j]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1){
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0;i<100;i++){
if(option==bags[i].cnn){
flag_bag[i]=1;
for(int j=i+1;j<100;j++){
bags[j].cnn--;
}
cout<<"丢弃成功";
return;
}
}
}
}
void box(){
int sum=0;
for(int i=0;i<20;i++){
for(int j=0;j<5;j++){
if(!flag_box[i])
cout<<boxs[i].cnn<<":"<<boxs[i].boxx[j]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1){
Sleep(1000);
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0;i<100;i++){
if(option==bags[i].cnn){
flag_box[i]=1;
for(int j=i+1;j<100;j++){
bags[j].cnn--;
}
cout<<"丢弃成功";
return;
}
}
}
}
int main12(){
if(grade==0){
grade++;
}
if(jinyan>=experience[grade]){
grade++;
jinyan-=experience[grade-1];
}
if(exits==1){
return 0;
}
board();
cin>>option;
if(option==1){
maps();
if(exits==1){
return 0;
}
main12();
}else if(option==2){
bag();
main12();
}else if(option==3){
box();
main12();
}else if(option==4){
equips();
main12();
}else if(option==5){
skill_board();
main12();
}
}
void lingdong(){
cout<<"欢迎来到灵洞"<<endl;
Sleep(1000);
cout<<"1.刷级(等级高) 2.泡温泉";
cin>>option;
if(option==1){
cout<<"你遇见了——"<<endl;
Sleep(1000);
savage=rand()%2;
if(savage==0){
double x=rand()%(100-80+1)+80;
cout<<"碧水金睛兽"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=attack*1.5;
double temf=defense*1.5;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
if(temb<=0){
cout<<"你赢了";
int n=rand()%20+1;
if(n==1){
cout<<",你获得了碧水金睛兽一只";
}else{
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
while(true){
int y1=boss_shanghai(x);
tema-=y1+jianshang(defense);
cout<<"碧水金睛兽打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
int y2=shanghai(attack);
temb-=y2;
temb+=jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"碧水金睛兽还剩"<<temb<<"滴血";
Sleep(1000);
if(temb<=0){
cout<<"你赢了";
int n=rand()%20+1;
if(n==1){
cout<<",你获得了碧水金睛兽一只";
}else{
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}else if(savage==1){
double x=rand()%(100-80+1)+80;
cout<<"太古龙象"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=attack*1.5;
double temf=defense*1.5;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
while(true){
int y1=boss_shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"太古龙象打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
}
}
}else if(option==2){
cout<<"请输入要泡的时间";
cin>>times;
for(int i=1;i<=times;i++){
cout<<i<<" ";
Sleep(1000);
jinyan++;
}
cout << "你加了" <<times<<"点经验";
Sleep(1000);
}else{
return;
}
}
void equips(){
cout<<"暂时为空";
// cout<<"头部:"<<head<<endl;
// cout<<"胸甲:"<<body<<endl;
// cout<<"裤子:"<<trousers<<endl;
// cout<<"鞋子:"<<shoes<<endl;
// cout<<"武器:"<<
// cout<<endl;
// cout<<"请问是否要调整装备"<<endl;
// cout<< "1.要 2.不要";
// cin>>option;
// if(option==1){
// bag2();
// cout<<"请输入要替换的装备的名称"<<endl;
// string a;
// cin>>a;
// for(int i=0;i<100;i++){
// if()
// }
//
// }
}
void equip_bag(){
cout<<"暂时为空";
}
void skill_board(){
cout<<"暂时为空";
}
void zhanchang(){
cout<<"删除";
}
void huo(){
cout<<"流火之地"<<endl;
cout<<"这里是火神祝融坐化的地方"<<endl;
cout<<"1.下矿 2.探险";
cin>>option;
int exits1=0;
if(option==1){
while(!exits1){
cout<<"挖矿中..."<<endl;
Sleep(3000);
int y=rand()%3+1;
if(y==1){
cout<<"恭喜你获得了 炎溶石 "<<endl;
}
y=rand()%50+1;
if(y==5){
cout<<"因为你是火系"<<endl;
cout<<"恭喜你找到了 火神传承 "<<endl;
grade++;
if(attribute==4){
cout<<"火神真迹 技能:焚毁"<<endl;
jineng[1]=1;
}
}
cout<<"恭喜你获得了 岩溶石 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
if(option==2){
exits1=1;
}
}
}else{
cout<<"你遇到了---"<<endl;
int n=rand()%2;
if(n==0){
double x=rand()%20;
cout<<"熔岩虫"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=5;
double temf=0;
cout<<name<<"开始释放技能";
Sleep(1000);
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
cout<<"火神术--"<<endl;
Sleep(1000);
cout<<"焚毁!"<<endl;
Sleep(1000);
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石 "<<endl;
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
while(true){
int y1=shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"熔岩虫打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石";
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
}
}else if(n==1){
int op2=rand()%3;
if(op2==0||op2==1){
double x=rand()%60+30;
cout<<"熔岩地龙"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=5;
double temf=1;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
cout<<"火神术--"<<endl;
Sleep(1000);
cout<<"焚毁!"<<endl;
Sleep(1000);
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了 地龙之心 "<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 熔炎宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
while(true){
int y1=shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"熔岩地龙打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了 地龙之心 "<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 熔炎宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
}
void bin(){
cout<<"暂时为空";
}
void jin(){
cout<<"删除";
}
void shu(){
cout<<"恶魔树林"<<endl;
cout<<"这里是恶魔居住的地方"<<endl;
cout<<"1.撸树 2.闲逛(与恶魔干架)";
cin>>option;
int exits1=0;
if(option==1){
while(!exits1){
cout<<"撸树中..."<<endl;
Sleep(3000);
int y=rand()%5+1;
if(y==1){
cout<<"恭喜你获得了 藤条"<<endl;
}
y=rand()%10+1;
if(y==5){
cout<<"恭喜你惹怒了 树神 "<<endl;
grade++;
cout<<"但是树神早已被这里隐藏的恶魔折磨的虚弱不堪"<<endl;
Sleep(1000);
cout<<"他想让你干掉恶魔"<<endl;
Sleep(1000);
cout<<"他需要你"<<endl;
Sleep(1000);
if(attribute==2){
cout<<"因为你是木系"<<endl;
Sleep(1000);
cout << "所以你获得了树神的传承 千手顶上化佛"<<endl;
Sleep(1000);
jineng[2]=1;
}
}
cout<<"恭喜你获得了 木头 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
if(option==2){
exits1=1;
}
}
}
}
void lu(){
cout<<"阿努比斯的大陆沙漠"<<endl;
cout<<"这里是阿努比斯被封印的地方"<<endl;
}
int shanghai(double gong){
int bao=0;
int n=10*((double)gong/100);
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
ops[i]=1;
}
if(ops[op]){
return n*(rand()%3+1);
bao=1;
}else{
return n;
}
}
int jianshang(double fang){
return (double)fang/10;
}
int boss_shanghai(double gong){
int bao=0;
int n=10*((double)gong/100);
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
ops[i]=1;
}
if(ops[op]){
return n*(rand()%2+1);
bao=1;
}else{
return n;
}
}
void ten(){
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[10][10] =
{
......@@ -17,10 +741,8 @@ void ten()
{'#','#',' ',' ',' ',' ','#','#',' ','#'},
{'#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
for(int i = 0; i < 10; i++){
for(int j = 0; j < 10; j++){
cout << a[i][j] << " ";
}
cout << endl;
......@@ -28,52 +750,45 @@ void ten()
char ch;
int x = 4, y = 1;
int q = 1, p = 9;
while(ch = getch())
{
while(ch = getch()){
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#')
{
if(ch == 'w' && a[x - 1][y] != '#'){
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#')
{
else if(ch == 's' && a[x + 1][y] != '#'){
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#')
{
else if(ch == 'a' && a[x][y - 1] != '#'){
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#')
{
else if(ch == 'd' && a[x][y + 1] != '#'){
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
for(int i = 0; i < 10; i++){
for(int j = 0; j < 10; j++){
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p)
{
cout << "win";
if(x == q && y == p){
cout << "win"<<endl;
cout<<"你将获得10点经验"<<endl;
jinyan+=10;
break;
}
}
}
void eleven()
{
void eleven(){
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[11][11] =
{
......@@ -89,10 +804,8 @@ void eleven()
{'#','#','#',' ',' ',' ',' ',' ',' ','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 11; i++)
{
for(int j = 0; j < 11; j++)
{
for(int i = 0; i < 11; i++){
for(int j = 0; j < 11; j++){
cout << a[i][j] << " ";
}
cout << endl;
......@@ -100,51 +813,44 @@ void eleven()
char ch;
int x = 1, y = 1;
int q = 6, p = 10;
while(ch = getch())
{
while(ch = getch()){
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#')
{
if(ch == 'w' && a[x - 1][y] != '#'){
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#')
{
else if(ch == 's' && a[x + 1][y] != '#'){
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#')
{
else if(ch == 'a' && a[x][y - 1] != '#'){
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#')
{
else if(ch == 'd' && a[x][y + 1] != '#'){
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 11; i++)
{
for(int j = 0; j < 11; j++)
{
for(int i = 0; i < 11; i++){
for(int j = 0; j < 11; j++){
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p)
{
cout << "win";
if(x == q && y == p){
cout << "win"<<endl;
cout<<"你将获得11点经验"<<endl;
jinyan+=11;
break;
}
}
}
void twelve()
{
void twelve(){
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[12][12] =
{
......@@ -160,10 +866,8 @@ void twelve()
{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 12; i++)
{
for(int j = 0; j < 12; j++)
{
for(int i = 0; i < 12; i++){
for(int j = 0; j < 12; j++){
cout << a[i][j] << " ";
}
cout << endl;
......@@ -171,51 +875,44 @@ void twelve()
char ch;
int x = 2, y = 1;
int q = 5, p = 11;
while(ch = getch())
{
while(ch = getch()){
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#')
{
if(ch == 'w' && a[x - 1][y] != '#'){
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#')
{
else if(ch == 's' && a[x + 1][y] != '#'){
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#')
{
else if(ch == 'a' && a[x][y - 1] != '#'){
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#')
{
else if(ch == 'd' && a[x][y + 1] != '#'){
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 12; i++)
{
for(int j = 0; j < 12; j++)
{
for(int i = 0; i < 12; i++){
for(int j = 0; j < 12; j++){
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p)
{
cout << "win";
if(x == q && y == p){
cout << "win"<<endl;
cout<<"你将获得12点经验"<<endl;
jinyan+=12;
break;
}
}
}
void thirteen()
{
void thirteen(){
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[13][13] =
{
......@@ -233,10 +930,8 @@ void thirteen()
{'#',' ',' ',' ',' ',' ','#',' ',' ','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 13; i++)
{
for(int j = 0; j < 13; j++)
{
for(int i = 0; i < 13; i++){
for(int j = 0; j < 13; j++){
cout << a[i][j] << " ";
}
cout << endl;
......@@ -244,51 +939,44 @@ void thirteen()
char ch;
int x = 2, y = 1;
int q = 7, p = 12;
while(ch = getch())
{
while(ch = getch()){
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#')
{
if(ch == 'w' && a[x - 1][y] != '#'){
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#')
{
else if(ch == 's' && a[x + 1][y] != '#'){
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#')
{
else if(ch == 'a' && a[x][y - 1] != '#'){
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#')
{
else if(ch == 'd' && a[x][y + 1] != '#'){
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 13; i++)
{
for(int j = 0; j < 13; j++)
{
for(int i = 0; i < 13; i++){
for(int j = 0; j < 13; j++){
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p)
{
cout << "win";
if(x == q && y == p){
cout << "win"<<endl;
cout<<"你将获得13点经验"<<endl;
jinyan+=13;
break;
}
}
}
void forteen()
{
void forteen(){
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[14][14] =
{
......@@ -307,10 +995,8 @@ void forteen()
{'#','#','#','#','#','#',' ',' ',' ','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 14; i++)
{
for(int j = 0; j < 14; j++)
{
for(int i = 0; i < 14; i++){
for(int j = 0; j < 14; j++){
cout << a[i][j] << " ";
}
cout << endl;
......@@ -318,73 +1004,61 @@ void forteen()
char ch;
int x = 2, y = 1;
int q = 4, p = 13;
while(ch = getch())
{
while(ch = getch()){
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#')
{
if(ch == 'w' && a[x - 1][y] != '#'){
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#')
{
else if(ch == 's' && a[x + 1][y] != '#'){
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#')
{
else if(ch == 'a' && a[x][y - 1] != '#'){
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#')
{
else if(ch == 'd' && a[x][y + 1] != '#'){
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 14; i++)
{
for(int j = 0; j < 14; j++)
{
for(int i = 0; i < 14; i++){
for(int j = 0; j < 14; j++){
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p)
{
cout << "win";
if(x == q && y == p){
cout << "win"<<endl;
cout<<"你将获得14点经验"<<endl;
jinyan+=14;
break;
}
}
}
int main()
{
void shenming(){
int n;
cout << "请输入你想要的级别 1 ~ 5" << endl;
cin >> n;
if(n == 1)
{
if(n == 1){
ten();
}
else if(n == 2)
{
else if(n == 2){
eleven();
}
else if(n == 3)
{
else if(n == 3){
twelve();
}
else if(n == 4)
{
else if(n == 4){
thirteen();
}
else if(n == 5)
{
else if(n == 5){
forteen();
}
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册