问题标题: 酷町堂:小游戏~

0
0
已解决
徐子宸
徐子宸
中级天翼
中级天翼

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int player[100000001],sf[100000001],buy,computer,score,cishu,win,lose,tili=10,co,a,b,c,d,meichao=1;
int isvip=0,ismvp=0,xingyv=100;
void out();
void judge();
void timu(int);
void zhiliwenda();
void screen();
void screan();
void computer_lose();
void player_lose();
void tin();
void tili_0();
void fight();
void store();
void color();
void waigua();
void meiyuan();
void jianjei();
void chengfa();
int main()
{
srand((int)time(0));
system("color 9F");
cout<<"欢迎来到石头剪刀布bai大战2.8版本!";
ofstream fout("C:\\Program Files\\石头剪刀布.txt");
Sleep(2000);
cout<<endl;
screen();
return 0;
}
void out(string s)
{
int i;
for(i=0;i<=s.length();i++)
{
cout<<s[i];
Sleep(20);
}
}
void screen()
{
while(1)
{
system("cls");
if(xingyv<=0)
{
out("信誉为0,休息一会,马上回来!");
cout<<endl;
int i,yushu;
for(i=1;i<=rand()%20;i++)
{
yushu=i%8;
switch(yushu)
{
case 0:
{
system("color 0F");
out("吃鸡du三级头套装,限购10个哟!");
system("cls");
break;
}
case 1:
{
system("color 3F");
out("我的zhi世界头套100个,现在大促销,快来买哟!");
system("cls");
break;
}
case 2:
{
system("color AF");
out("装逼专用机器,还送10年保修哟!");
system("cls");
break;
}
case 3:
{
system("color BF");
out("吃鸡专用98k,800里外一枪爆头!");
system("cls");
break;
}
case 4:
{
system("color AB");
out("王者10000000份外挂大放送,手快有手慢无!");
system("cls");
break;
}
case 5:
{
system("color 0F");
out("联* x220i笔记本电脑出售,抢购只在1秒间!");
system("cls");
break;
}
case 6:
{
system("color 1F");
out("6666666,6666666,6666666,6666666");
system("cls");
xingyv+=100;
break;
}
}
}
zhiliwenda();
}
system("cls");
if(score<0)
{
chengfa();
system("cls");
break;
}
out("你现在有");
cout<<score;
out("张毛爷爷,");
cout<<meichao;
out("美元,");
cout<<tili;
out("点体力值,");
cout<<win;
out("次胜利,");
cout<<lose;
out("次失败,");
cout<<isvip;
out("张VIP卡,");
cout<<ismvp;
out("张MVP卡,");
cout<<xingyv;
out("信誉积分.");
cout<<endl;
out("现在,你可以有以下选择:");
cout<<endl;
out("1:人机大战");
cout<<endl;
out("2:购买道具");
cout<<endl;
out("3.游戏简介");
cout<<endl;
out("4:外挂");
cout<<endl;
out("5:调整设置");
int in;
cout<<endl;
cin>>in;
switch(in)
{
case 1:
fight();
system("cls");
break;
case 2:
store();
system("cls");
break;
case 3:
jianjei();
system("cls");
break;
case 4:
waigua();
system("cls");
case 5:
color();
system("cls");
default:
out("输错了,请重试。");
}
}
}
void jianjei()
{
int o;
printf("本游戏版权归属为学神,请勿盗版。本版本预计10月12日更新,如有延迟请恕罪。2.8版本跟新了外挂和信誉积分模式,后面可能完善,整体功能提高。请大家散布通缉令通缉李明浩 江月路两人谢谢");
printf("下一个版本可能会有信誉积分的兑换和奖励,请点个赞") ;
printf("点赞打1否则打2");
scanf("%d",&o);
if(o==1)
{
score+=10;
}
else
{
score-=10;
}
}
void fight()
{
if(xingyv>=20)
{
cishu++;
tili--;
xingyv-=(rand()%10);
out("你先出。");
cout<<endl;
out("1:石头");
cout<<endl;
out("2:剪刀");
cout<<endl;
out("3:布");
cout<<endl;
out("你出的是:");
cin>>player[cishu];
if(player[cishu]>=4 || player[cishu]<=0)
{
out("无效输入。");
return;
}
computer=(rand()%3)+1;
switch(computer)
{
case 1:
out("电脑出的是石头。");
break;
case 2:
out("电脑出的是剪刀。");
break;
case 3:
out("电脑出的是布。");
break;
}
judge();
}
else
{
printf("信誉积分不足");
xingyv+=5;
}
}
void computer_lose()
{
out("玩家胜利!");
cout<<endl;
sf[cishu]=1;
score+=((rand()%5)+6);
win++;
}
void player_lose()
{
out("玩家失败!");
cout<<endl;
sf[cishu]=-1;
lose++;
}
void tin()
{
out("平局!");
cout<<endl;
}
void store()
{
system("cls");
out("欢迎来到《石头剪刀布》士多店。您有");
cout<<score;
out("张毛爷爷。");
cout<<isvip;
out("张VIP卡");
cout<<ismvp;
out("张MVP卡");
cout<<endl;
out("请问您要买什么?");
cout<<endl;
out("1:失败记录修改器。可以减少一次失败记录。¥5");
cout<<endl;
out("2:胜利记录修改器。可以增加一次胜利记录。¥8");
cout<<endl;
out("3:冰阔落。可以增加5点体力值。¥5");
cout<<endl;
out("4:兴奋剂。可以增加10点体力值。¥10");
cout<<endl;
out("5:一次性刷钱机。可以增加随机价格的毛爷爷。¥10");
cout<<endl;
out("6:商场VIP会员卡。能给商品降低80%价格。¥50");
cout<<endl;
out("7:战无不胜卡(五次,vip和mvp不降价)。¥25");
cout<<endl;
out("8:商场MVP权限。可降价50%。在VIP的基础上再加多100块。");
cout<<endl;
out("9:退出。");
cout<<endl;
out("10:100信誉积分(只有VIP和MVP才能买) ¥300");
cout<<endl;
out("11:解锁全游戏。胜利10次即可购买。");
cout<<endl;
out("12:管理员权限。战胜500次即可获得。");
cin>>buy;
if(isvip>=1&&ismvp<=0)
{
switch(buy)
{
case 1:
score-=4;
lose--;
break;
case 2:
score-=6;
win++;
break;
case 3:
score-=4;
tili+=5;
break;
case 4:
score-=8;
tili+=10;
break;
case 5:
score-=8;
score+=(rand()%100);
break;
case 6:
isvip=1;
out("VIP权限申请成功。");
score-=40;
break;
case 7:
win+=5;
for(int i=cishu;i<=cishu+5;i++)
{
sf[i]=1;
cishu++;
}
break;
case 8:
ismvp=1;
out("VIP成功升级为MVP。");
isvip-=1;
score-=120;
break;
case 9:
score+=1;
case 10:
score-=300;
xingyv+=100;
if(score<0) out("操你妈的,居然敢不带够钱买东西,给老子滚出去!"),win=0,score=0,lose=1000000;
}
}
if(ismvp>=1)
{
switch(buy)
{
case 1:
score-=3;
lose--;
break;
case 2:
score-=4;
win++;
break;
case 3:
score-=3;
tili+=5;
break;
case 4:
score-=5;
tili+=10;
break;
case 5:
score-=5;
score+=(rand()%100);
break;
case 6:
isvip=1;
out("VIP权限申请成功。");
score-=25;
break;
case 7:
win+=5;
for(int i=cishu;i<=cishu+5;i++)
{
sf[i]=1;
cishu++;
}
break;
case 8:
ismvp=1;
out("VIP成功升级为MVP。");
isvip-=1;
score-=75;
break;
case 9:
score+=1;
break;
case 10:
score-=300;
xingyv+=100;
//ofstream fout("")
if(score<0) out("操你妈的,居然敢不带够钱买东西,给老子滚出去!"),win=0,score=0,lose=1000000;
}
}
if(isvip<=0&&ismvp<=0)
{
switch(buy)
{
case 1:
score-=5;
lose--;
break;
case 2:
score-=8;
win++;
break;
case 3:
score-=5;
tili+=5;
break;
case 4:
score-=10;
tili+=10;
break;
case 5:
score-=10;
score+=(rand()%100);
break;
case 6:
isvip=1;
out("VIP权限申请成功。");
score-=50;
break;
case 7:
win+=5;
for(int i=cishu;i<=cishu+5;i++)
{
sf[i]=1;
cishu++;
}
break;
//ofstream fout("")
if(score<0)
out("操你妈的,居然敢不带够钱买东西,给老子滚出去!"),win=0,score=0,lose=1000000;
}
}
}
void waigua()
{
printf("密码1:");
scanf("%d",&a);
printf("密码2:");
scanf("%d",&b);
c=a+b;
if(c==5201314)
{
score+=200;
printf("谁是学神?");
printf("1.甘子钰");
printf("2.李明浩");
printf("3.李瑜桓");
printf("4.龙立轩");
printf("5.这一题不适合我,退出");
scanf("%d",&d);
if(d==1||d==3)
{
printf("你答对了,真棒");
score+=500;
}
if(d==2||d==4)
{
printf("错了,减100毛爷爷");
score-=100;
}
if(d==5)
{
printf("拜拜,给你1个毛爷爷");
score+=1;
}
if(d>5)
{
printf("调皮蛋,罚50毛爷爷");
score-=50;
}
}
else
{
score=0;
}
}
void chengfa()
{
int cv;
if(score<0)
{
printf("惩罚开始");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("1.....................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("......................................");
printf("刚刚多余的是什么数字");
scanf("%d",&cv);
if(cv==1)
{
score+=50;
}
else
{
chengfa();
system("cls");
}
}
}
void color()
{
out("你要什么字体颜色?");
cout<<endl;
out("黑色:按1");
cout<<endl;
out("蓝色:按2");
cout<<endl;
out("绿色:按3");
cout<<endl;
out("浅绿色:按4");
cout<<endl;
out("红色:按5");
cout<<endl;
out("紫色:按6");
cout<<endl;
out("黄色:按7");
cout<<endl;
out("白色:按8");
cout<<endl;
out("灰色:按9");
cout<<endl;
out("淡蓝色:按A");
cout<<endl;
out("淡绿色:按B");
cout<<endl;
out("淡浅绿色:按C");
cout<<endl;
out("淡红色:按D");
cout<<endl;
out("淡紫色:按E");
cout<<endl;
out("淡黄色:按F");
cout<<endl;
out("亮白色:按G");
cout<<endl;
char c;
cin>>c;
switch(c)
{
case '1':
system("color 0");
break;
case '2':
system("color 1");
break;
case '3':
system("color 2");
break;
case '4':
system("color 3");
break;
case '5':
system("color 4");
break;
case '6':
system("color 5");
break;
case '7':
system("color 6");
break;
case '8':
system("color 7");
break;
case '9':
system("color 8");
break;
case 'A':
system("color 9");
break;
case 'B':
system("color A");
break;
case 'C':
system("color B");
break;
case 'D':
system("color C");
break;
case 'E':
system("color D");
break;
case 'F':
system("color E");
break;
case 'G':
system("color F");
break;
default:
system("color");
break;
}
out("调颜色成功。");
}
void judge()
{
if(player[cishu]==1)
{
if(computer==2)
{
computer_lose();
}
if(computer==3)
{
player_lose();
}
if(computer==1)
{
tin();
}
}
if(player[cishu]==2)
{
if(computer==3)
{
computer_lose();
}
if(computer==1)
{
player_lose();
}
if(computer==2)
{
tin();
}
}
if(player[cishu]==3)
{
if(computer==1)
{
computer_lose();
}
if(computer==2)
{
player_lose();
}
if(computer==3)
{
tin();
}
}
}
void zhiliwenda()
{
system("cls");
system("color 9F");
for(int i=1;i<=10;i++)
timu(rand()%10);
tili+=5;
}
void timu(int in)
{
int input;
switch(in)
{
case 0:
{
out("0~31有几个数?");
cout<<endl;
cin>>input;
if(input==32)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("脑子有问题。");
timu(rand()%10);
}
}
break;
case 1:
{
out("0,1,1,2,3,5,8,后面是什么?");
cout<<endl;
cin>>input;
if(input==13)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("sb。");
timu(rand()%10);
}
}
break;
case 2:
{
out("9,61,52,63,94,后面是什么?");
cout<<endl;
cin>>input;
if(input==64)
{
out("被你给答对了,真是不可思议!");
return;
}
else
{
out("6666666。");
timu(rand()%10);
}
}
break;
case 3:
{
out("求7分之1的小数点后第1000位是多少。");
cout<<endl;
cin>>input;
if(input==8)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。");
timu(rand()%10);
}
}
break;
case 4:
{
out("求13分之1的小数点后第1000位是多少。");
cout<<endl;
cin>>input;
if(input==9)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。");
timu(rand()%10);
}
}
break;
case 5:
{
out("2^16=?");
cout<<endl;
cin>>input;
if(input==65536)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。。。");
timu(rand()%10);
}
}
break;
case 6:
{
out("一吨水多少钱?");
cout<<endl;
cin>>input;
if(input>=3&&input<=8)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。666666666。。。");
timu(rand()%10);
}
}
break;
case 7:
{
out("求你一天吃几碗饭。");
cout<<endl;
cin>>input;
if(input<=2)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("吃货!");
timu(rand()%10);
}
}
break;
case 8:
{
out("求标准钢琴有几个键。");
cout<<endl;
cin>>input;
if(input==88)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。。。估计不弹钢琴。。。");
timu(rand()%10);
}
}
break;
case 9:
{
out("本游戏至少有多少行?");
cout<<endl;
cin>>input;
if(input>=600)
{
out("被你答对了,真是不可思议!");
return;
}
else
{
out("这都不会。");
timu(rand()%10);
}
}
break;
}
}
void screan()
{
while(1)
{
system("cls");
if(tili<=0)
{
out("体力为0,休息一会,马上回来!");
cout<<endl;
int i,yushu;
for(i=1;i<=rand()%20;i++)
{
yushu=i%8;
switch(yushu)
{
case 0:
{
system("color 0F");
out("吃鸡三级头套装,限购10个哟!");
system("cls");
break;
}
case 1:
{
system("color 3F");
out("我的世界头套100个,现在大促销,快来买哟!");
system("cls");
break;
}
case 2:
{
system("color AF");
out("装逼专用机器,还送10年保修哟!");
system("cls");
break;
}
case 3:
{
system("color BF");
out("吃鸡专用98k,800里外一枪爆头!");
system("cls");
break;
}
case 4:
{
system("color AB");
out("王者10000000份外挂大放送,手快有手慢无!");
system("cls");
break;
}
case 5:
{
system("color 0F");
out("联* x220i笔记本电脑出售,抢购只在1秒间!");
system("cls");
break;
}
case 6:
{
system("color 1F");
out("6666666,6666666,6666666,6666666");
system("cls");
break;
}
}
}
zhiliwenda();
}
system("cls");
out("你现在有");
cout<<score;
out("张毛爷爷,");
cout<<tili;
out("点体力值,");
cout<<win;
out("次胜利,");
cout<<lose;
out("次失败。");
cout<<isvip;
out("张VIP卡");
cout<<ismvp;
out("张MVP卡");
cout<<xingyv;
out("信誉积分");
cout<<endl;
out("现在,你可以有以下选择:");
cout<<endl;
out("1:人机大战");
cout<<endl;
out("2:购买道具");
cout<<endl;
out("3.游戏简介");
cout<<endl;
out("4:外挂");
cout<<endl;
out("5:调整设置");
int in;
cin>>in;
switch(in)
{
case 1:
fight();
system("cls");
break;
case 2:
store();
system("cls");
break;
case 3:
jianjei();
system("cls");
break;
case 4:
waigua();
system("cls");
case 5:
color();
system("cls");
default:
out("输错了,请重试。");
}
}
}


0
0
0
李瑞曦
李瑞曦
高级天翼
高级天翼

这是你自己写的吗???【有点可疑】

0
0
潘晨皓
潘晨皓
高级天翼
高级天翼

这……

骂人的话不免太多

0
0
曹砚青
曹砚青
中级光能
中级光能

小伙子,要是你抄的游戏代码被他看到了,那............一路走好

我要回答