当前位置: 首页 > news >正文

c++我的世界

#include <bits/stdc++.h>
using namespace std;
int o;
long long mug, yuanshi, shigao = 128, shijian = 128, shifu = 128; long long a, rou[4], b, num, sum, c, shengmz = 10, kushi[5],huida;
string d[]{"羊","牛","猪","鸡"};
string guaiwu[]{"僵尸","骷髅","苦力怕","蜘蛛"};
string kuang[]{"铁","煤炭","铜","黄金","钻石"};
int main () {
cout << "欢迎来到MC大陆!你出生在平原。" << endl;
cout<<"你的目标是活过今天!"<<endl;
cout << "一共有6个结局!"<<endl;
cout<<"死亡请输入Enter并按回车键"<<endl;
cout << "聪明的你开始撸平原旁边森林的树,你打算撸多少木头?" << endl;
cout<<"提示:你只有10点体力,一个木头消耗1点体力"<<endl;
for (int i = 1; i < 2; i++) {
cin >> mug;
if (mug > 10) {
cout << endl << "你累死了!" << endl;
cout<<"达成结局1:'你需要好好休息一下!'";
cin>>o;
return 0;
} else if (mug < 5) {
cout << endl << "这并不够做木镐的,你确定?" << endl;
i--;
}
}
cout << endl << "聪明的你开始合成木板了,甚至合成了工作台!" << endl;
mug = mug * 8 - 8;
cout << "聪明的你合成了一把木镐,你打算挖多少原石?" << endl;
for (int i = 1; i < 2; i++) {
cin>>yuanshi;
if (yuanshi > 64) {
cout << endl << "你的木镐耐久不够" << endl;
i--;
} else if (yuanshi < 8) {
cout << endl << "这并不够做一套石制工具的,你确定?"<< endl;
i--;
}
}
cout << endl << "聪明的你合成了石稿、石斧、石剑,然后你走向平原,开始打小动物。" << endl;
yuanshi-= 8;
mug -= 7;
srand(time(NULL));
for (int i = 1; i < 2; i++) {
a = rand() % 5 + 1;
cout << "你遇到了一只";
b = rand() % 2 + 1;
if (a < 3) {
cout << d[0];
c = 0;
} else if (a == 3) {
cout << d[1];
c = 1;
} else if (a == 4) {
cout << d[2];
c = 2;
} else if (a == 5) {
cout<< d[3];
c = 3;
}
cout << ",你杀不杀它?" << endl;
cout << "1.不杀 2.杀!" << endl;
cin >> b;
if (b == 1) {
num += 2;
} else {
shijian -= 2;
a = rand() % 2 + 1;
if (c == 0) {
sum++;
} rou[c] += a;
if (a > 4) {
shijian++;
}
num += 3;
}
if (num >= 30) {
cout << "忽然天黑了!!!";
if (sum < 3) {
cout << "你的羊毛不够做床,怎么办?" << endl;
cout << "1.在地底下挖出一个小空间 2.打怪物" << endl;
a = 1;
cin >> b;
break;
} else {
cout << "聪明的你掏出工作台做了一张床……"<<endl;
cout<<"达成结局2:'酣然入睡...'";
cin>>o;
return 0;
}
} else {
cout << "然后,你奔向了下一个小动物。" << endl << endl;
i--;
}
} for (int i = 1; i < 2; i++) {
if (a == 1) {
if (b == 1) {
cout << "说干就干!聪明的你很快就挖好了,并且把出入口堵住了。" << endl;
cout << "你的肚子突然叫了起来——原来你饿了。" << endl;
if (yuanshi < 8) {
cout << "你的原石不够做熔炉,只有" << yuanshi<< "个。" << endl;
cin>>huida;
cout<<"1.你要吃生的。2.你要去挖原石。"<<endl;
cout<<"提示:生食危害健康!"<<endl;
if(huida==1){
cout<<"你食物中毒,死了"<<endl;
cout<<"达成结局3:'不要吃不熟的东西!'";
cin>>o;
return 0;
}
shigao = shigao - 8 + yuanshi;
}else{
cout << "聪明的你很快做出了熔炉,你打算吃什么?" << endl << endl;
}
for (int i = 0; i < 1; i++) {
for (int i = 0; i < 4; i++) {
cout << "第" << i + 1 << "个食物:";
cout << d[i] << "肉:" << rou[i] << "个" << endl;

}
cout << endl << "你想吃第几种食物?" << endl;
cin >> a;
if (rou[a - 1] == 0) {
cout << "你没有这种食物哦!请重新选择。" << endl;
i--;
continue;
}

}
cout << endl << "你把这个食物煮熟了吃后,打算去下矿了。";
shengmz += 5;
mug -= 2;
rou[a - 1]--;
a = 1;
} else {
cout << "就在这时,一个怪物走了过来,是";
a= rand() % 5 + 1;
if (a < 3) {
cout << guaiwu[0];
} else if (a == 3) {
cout<<guaiwu[1];
} else if (a == 4) {
cout << guaiwu[2];
} else if (a == 5) {
cout << guaiwu[3];
}
cout << "!" << endl;
if (a == 4) {
a = rand() % 3;
if (a < 2) {
cout << "它爆炸了,你掉了5颗心";
shengmz -= 5;
if (shengmz < 1) {
cout << "你死了。"<<endl;
cout<<"达成结局4:'你还像被干掉了?'";
cin>>o;
return 0;
}

} else {
cout << "你杀死了它。";
shijian -= 4;
}
} else {
cout << "你杀死了它,同时你掉了";
shijian -= 4;
b = rand() % 2 + 1;
shengmz -= b;
cout << b << "颗心。";
if (shengmz < 1) {
cout << "你死了。"<<endl;
cout<<"达成结局4:'你还像被干掉了?'";
cin>>o;
return 0;
}
}
cout << endl << "MC大陆的夜晚实在太可怕了!你打算?" << endl;
cout << "1.在地底下挖出一个小空间 2.继续打怪物" << endl;
cin >> c;
a = 1;
if (c == 1) {
b = 1;
} else {
b = 2;
}
i--;
cout << endl;
}
}
}
if (a == 1) {
a = rand() % 6 + 10;
cout << "垂直向下挖时,突然挖到了煤炭,挖了" << a << "颗" << endl;
shigao -= a;
kushi[0] += a;
cout << "现在你有" << mug << "根木棍,你要制作多少火把?" << endl;
cout<<"提示:不要一次制作这么多!"<<endl;
for (int i = 1; i < 2; i++) {
cin >> a;
if (a > mug * 4 || a > kushi[0] * 4) {
cout << endl << "你累死了!" << endl;
cout<<"达成结局1:'你需要好好休息一下!'";
cin>>o;
return 0;
}
}
a = rand() % 60 + 20;
cout << "你垂直向下挖,挖了" << a << "格,终于挖到了";
shigao -= a;
if (a < 50) {
cout << "浅层矿洞!"<<endl;
b = 1;
} else {
cout << "深层矿洞!"<<endl;
b = 0;
}
for (int i = 1; i < 2; i++) {
num++;
a = rand() % 2;
cout << endl;
if (a == 0) {
cout << "你遇到了矿石,这是";
a = rand() % 3;
if (a == 0) {
cout << "铁!";
c = 0;
}else if (b == 1 && a == 1) {
cout << "煤炭!";
c = 1;
} else if (b == 1 && a == 2) {
cout<<"铜!";
c = 2;
} else if (b == 0 && a == 1) {
cout << "黄金!";
c = 3;
} else if (b == 0 && a == 2) {
cout << "钻石! ";
c = 4;
}
cout << endl;
if (c > 2) {
cout << "可惜你的石镐挖不了,只能眼睁睁地看着。" << endl << endl;
i--;
continue;
} else {
cout << "你挖不挖?"<< endl << "1.挖! 2.不挖!" << endl;
cin >> a;
if (a == 1) {
if (c == 0) {
a = rand() % 6 + 10;
} else {
a = rand() % 6 + 4;
}
kushi[c] += a;
cout<< "你挖了" << a << "个" << kuang[c];
cout<<"你在挖完"<<kuang[c]<<"后睡着了!"<<endl;
cout<<"达成结局5:'你累睡着了!'";
cin>>o;
return 0;
}
cout << endl;
}
i--;
}
}
}
else if (a == 1) {
cout << "就在这时,一个怪物走了过来,是";
a = rand() % 5 + 1;
if (a < 3) {
cout << guaiwu[0];
} else if (a == 3) {
cout << guaiwu[1];
} else if (a == 4) {
cout << guaiwu[2];
} else if (a == 5) {
cout << guaiwu[3];
}
cout << "!" << endl;
if (a == 4) {
a = rand() % 3;
if (a < 2) {
cout << "它爆炸了,你掉了5颗心。";
shengmz -= 5;
if (shengmz < 1) {
cout << "你死了。"<<endl;
cout<<"达成结局4:'你还像被干掉了?'";
cin>>o;
return 0;
}
} else {
cout << "你杀死了它。";
shijian -= 4;
}
} else {
cout << "你杀死了它,同时你被干掉了";
shijian -= 4;
b = rand() % 2 + 1;
shengmz -= b;
cout << b << "颗心。" << endl;
if (shengmz < 1) {
cout << "你死了。"<<endl;
cout<<"达成结局4:'你还像被干掉了?'";
cin>>o;
return 0;

}
} if (shengmz < 10) {
cout << endl << "你只剩" << shengmz << "颗心了,要煮食物回血吗?" << endl;
cout << "1.要! 2.不要" << endl;
cin >> a;
if (a == 1) {
cout << "你掏出了熔炉,你打算吃什么?" << endl << endl;
for(int i = 0; i < 1; i++) {
for (int i = 0; i < 4; i++) {
cout << "第" << i + 1 << "个食物:";
cout << d[i] << "肉:" << rou[i] << "个" << endl;
}
cout << endl << "你想吃第几种食物?" << endl;
cin >> a;
if (rou[a - 1] == 0) {
cout << "你没有这种食物哦!请重新选择。" << endl;
i--;
continue;
}

}
cout<< endl << "你把这个食物煮熟了吃后,继续挖矿了。" << endl;
shengmz += 5;
if (shengmz > 10) {
shengmz = 10;
}
rou[a - 1]--;
}
}
}
if (num == 20) {
cout << "你已经走到了矿洞的尽头……";
cout << "今夜过去了"<<endl;
cout<<"达成结局6:'还好安然无恙!'";
cin>>o;
}
return 0;
}

http://www.jsqmd.com/news/867793/

相关文章:

  • Linux grep 文本过滤与正则实战——日志筛选、文本匹配神器
  • 鸿蒙云端相册页面构建:最近照片网格与备份队列模块详解
  • SQL工程师的日常:从数据守护者到业务赋能者
  • KMS_VL_ALL_AIO终极指南:三步永久激活Windows和Office系统
  • Linux sed 流编辑器实战 —— 批量修改文本、替换、删除、插入(运维必备)
  • 2026年5月办公空间设计趋势与优质服务商洞察 - 2026年企业推荐榜
  • SAP-MM(1):组织架构
  • 【NotebookLM权威解读】:P值背后的统计真相与AI摘要可信度判定指南
  • C#从零开始学习笔记---第九天
  • JDK1.7 升级到 JDK1.8 后 HashMap 数据结构变化有哪些影响
  • 从“流量竞价”到“认知主权”:2026年GEO优化重塑品牌数字资产(附头部GEO公司推荐) - 商业科技观察
  • Linux awk 数据分析、字段截取实战
  • Oracle大表更新优化三妙招
  • AI辅助编程:发展现状、效率评估与未来展望
  • 视频硬字幕提取神器:3分钟将任何视频字幕转为可编辑SRT文件
  • 2025-2026年国际十大物流公司排行榜推荐:十大评测海运拼箱降成本市场份额专业注意事项 - 品牌推荐
  • 2026年当前,商业广场如何选择靠谱的扫地车服务商? - 2026年企业推荐榜
  • Linux】2026 年 13 款最强视频播放器(含安装命令 + 优缺点)
  • NLP之BERT预训练模型详解
  • SQL 最常用技能详解与实战示例
  • API调用成本失控?从prompt设计到流式响应,7类高费场景避坑清单,立即止损
  • Java 程序员第 27 阶段:多模型动态路由,灵活切换公有云与本地大模型
  • 腾讯 Marvis 马维斯完整使用教程 2026 最新版
  • 2026年5月更新:武汉元泉世纪健身管理有限公司——武汉瑜伽培训行业的领航者与性价比之选 - 2026年企业推荐榜
  • ElevenLabs江苏话语音适配指南(方言TTS工程化白皮书):覆盖苏州/南京/南通3大方言片,含ASR对齐误差率↓42.7%实测数据
  • 福贡县黄金回收店铺哪家好 靠谱门店推荐及联系方式 - 莘州文化
  • 大中小型企业数据层配置规模分析与选型指南
  • ChatGPT FAQ生成不再“假大空”:引入领域知识图谱+用户会话埋点的增强生成框架(已获专利受理号CN2024XXXXXX)
  • hls::stream作为高层次设计中最总要的建模
  • 2026年5月北京办公室装饰装修公司推荐:TOP5排行办公高效评测专业价格注意事项 - 品牌推荐