教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 小学教育 >

模拟21点扑克牌游戏(C++课设)(3)

来源:网络收集 时间:2026-09-11
导读: cout\t\t取消╳(其它任意键取消)\n\t\t;cinenter; if(enter=='y'||enter=='Y') } else } int Display::showfile()//打开游戏规则文件 { ifstream in; in.open(e://c++课设//21点扑克牌游戏//rule,ios::in); if(!i

cout<<"\t\t取消╳(其它任意键取消)\n\t\t";cin>>enter; if(enter=='y'||enter=='Y') } else }

int Display::showfile()//打开游戏规则文件 {

ifstream in;

in.open("e://c++课设//21点扑克牌游戏//rule",ios::in); if(!in) { }

char s[1000]; while(!in.eof())

cout<<"打开规则失败,请按任意键返回上层"<<endl;; return -1; game.BeginFail(1,0); {

game.Log_in(password); game.RegisterSucceed(); game.RegisterFail(); else

}

void Display::DisplayRule()//3.打印游戏规则界面 {

cout<<"\n\n\n";

cout<<"\t\t\t\t游 戏 规 则\n\n\n"; game.showfile(); cout<<"\n\n\n\n";

cout<<"\t\t\t\t按任意键返回 "; getch(); game.cls();

game.DisplayMenu(); }

void Display::DisplayQuit()//4.退出游戏界面 {

cout<<"\n\n\n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 您的选择是明智的,赌博有害身心健康! ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 适量游戏,放松身心,请勿沉溺游戏 ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 我们不欢迎你频繁使用本程序! ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; Sleep(3000); exit(0); }

void Display::RegisterSucceed()//5.打印注册成功界面 {

Rank=0; Money=100; game.StoreUser(); { }

in.close(); return 0;

in.getline(s,sizeof(s)); cout<<s<<endl;

cout<<"\n\n\n\n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 注 册 成 功 ! ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 请按任意键返回登录 ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷"; Sleep(1000); getch(); game.cls();

game.DisplayMenu(); }

void Display::RegisterFail()// {

cout<<"\n\n\n\n\n\n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 注 册 失 败 ! ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷可能由于该用户名已存在,或者注册被取消 ∷\n"; cout<<"\t\t∷ 请按任意键返回 ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷"; Sleep(1000); getch(); game.cls();

game.DisplayMenu(); }

void Display::Begin()//6.打印登录成功界面 {

game.cls();

cout<<"\n\n\n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n\n\n"; cout<<"\t\t\t\t登 录 成 功 ! \n\n";

cout<<"\t\t\t尊敬的 "<<playername<<" 您好\n"; cout<<"\t\t\t您一共有现金: "<<Money<<"\t\n"; cout<<"\t\t\t\t\t\t\t\n";

cout<<"\t\t\t\t1.开始游戏 \n"; cout<<"\t\t\t\t2.升级用户 \n"; cout<<"\t\t\t\t3.用户退出 \n"; cout<<"\t\t\t\t4.游戏退出 \n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; Sleep(1000); game.InputMenu(); game.cls();

game.SelectMenu2(); }

void Display::BeginFail(int a,int b)// {

game.cls(); cout<<"\n\n\n\n\n";

cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ 登 录 失 败 ! ∷\n"; cout<<"\t\t∷ ∷\n"; if(a) { }

cout<<"\t\t∷ 请按任意键继续 ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷ ∷\n"; cout<<"\t\t∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷∷\n&quo …… 此处隐藏:1388字,全部文档内容请下载后查看。喜欢就下载吧 ……

模拟21点扑克牌游戏(C++课设)(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/43761.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)