【文件属性】:
文件名称:闯城堡游戏
文件大小:12KB
文件格式:CPP
更新时间:2016-04-18 07:28:56
闯城堡cpp
闯城堡小游戏 源代码
#include
#include
using namespace std;
class castle //封装类
{
private:
int a; //选择难易程度
int win,lost; //记录获胜失败的次数
public:
int sum; //总共玩了几次
void outside();
void roomone();
void roomtwonorth();
void roomtwoeast();
void roomtwowest();
void bravesoul();
void roomthreewest();
void dungeon();
void trapped();
void roomthreeeast();
void roomthreeeast2();
void backdoor();
void fireplace();
void fireplace2();
void parlor();
void outside2();
void outside3();
void easttower();
void roomone2();
void dungeon2();
void roomtwoeast2();
void doyouquit();
void choice(); //选择难易
void Sum()
{sum++;}
void printwin(); //输出你的记录
void printlost();
castle() //构造函数初始化
{
sum=0;
win=0;
lost=0;
}
};
int main()
{
castle cas;
cas.sum++;
cout<<" *---* *---* *---* *---*\n";
cout<<" | |___| | | |___| |\n";
cout<<" | | | |\n";
cout<<" | __ |______________| __ | \n";
cout<<" | / \\ | | / \\ |\n";
cout<<" | | | _______ | | |\n";
cout<<" | |__| / \\ |__| |\n";
cout<<" | | | |\n";
cout<<" | | | |\n";
cout<<" | | | |\n";
cout<<" |________________|_____|_______________|\n";
cout<<"\n欢迎你的到来!\n";
cout<<"\n\n";
cout<<"请选择难易程度。\n";
cout<<"\n";
cout<<"(1):简单\n";
cout<<"(2):一般\n";
cout<<"(3):困难\n";
cas.choice();
system("PAUSE");
cas.outside();
return 0;
}