拒绝AI,纯手写

#include <bits/stdc++.h>
#include <fstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <windows.h>
#include <vector>
#include <limits>
using namespace std;
vector<int> hui1;
void dy1(int x){
	cout<<"开始游戏 (y/n)";
	char cdy;
	cin>>cdy;
	if(cdy=='n') return ;
	for(int i=1;i<=7;i++) {
		cout<<"加载中.";
		Sleep(200);
		system("cls"); // 清屏
		cout<<"加载中..";
		Sleep(210);
		system("cls"); // 清屏
		cout<<"加载中...";
		Sleep(220);
		system("cls"); // 清屏
	}
	cout<<"*你出现";
	Sleep(80);
	cout<<"一个";
	Sleep(83);
	cout<<"阴森的走廊\n"; 
	int scd;
	cout<<"*你现在有两种选择..\n";
	cout<<" 1.向前走\n";
	cout<<" 2.推开旁边的房门\n";
	cin>>scd;
	if(scd==2){
		cout<<"*你没有钥匙...dasdfwe^&$dh\n"; 
		while(scd==2){
			cout<<"*你现在有两种选择..\n";
			cout<<" 1.向前走\n";
			cout<<" 2.推开旁边的房门\n";
			cin>>scd;
			if(scd==2){
				system("cls"); // 清屏
				cout<<"*你没有钥匙...\n";
			} 
		}
	}
	cout<<"*你向前走去...\n";
	cout<<" 1.靠墙走\n";
	cout<<" 2.大摇大摆的走过去\n";
	int kan;
	cin>>kan;
	if(kan==2){
		cout<<"You DIED\n\t死因:掉进陷阱了\n";
//		char hui;
//		cout<<"是否回档?(y/y)";	
//		cin>>hui;
//		return ;
		dy1(1);
	}
	cout<<"*你走过来了,你一阵后怕...\n";
	cout<<"*你遇到了";
	random_device run;
	mt19937 gen(run());
	uniform_int_distribution<>dist(1, 5);//改dist(1, 3)中的数 
	int r=dist(gen);
	switch(r){
		case 1:
			cout<<"大剑骷髅...\n";
			cout<<"危险程度:*****";
			break;
		case 2:
			cout<<"小型史莱姆\n";
			cout<<"*无危险度\n";
			char xun;
			cout<<"*是否驯服(y/n)";
			cin>>xun;
			if(xun=='n'){
				cout<<"你离开了...\n"; 
			} 
			else{
				random_device run1;
				mt19937 gen(run1());
				uniform_int_distribution<>dist(1, 2);//改dist(1, 3)中的数 
				int r1=dist(gen);
				if(r1==1){
					cout<<"驯服成功!\n";
				}
				else{
					cout<<"驯服失败!\n";
				}
				
			}
			
			break;
		}
//		case 3:
//			cout<<"";
//			break;
//		} 
	Sleep(28347923); 
}
//void huidang(int x){
//	cout<<"正在回档...9%^&*3h";
//	Sleep(3000);
////	goto start;
//}
int main() {

	cout<<"你想干甚么?";
	int dy=1;
	for(int i=1;;i++){
		cout<<"w/s键选择\n";
		char ws;
		cin>>ws;
		if(ws=='s'&&dy<2) dy++;
		if(ws=='w'&&dy>1) dy--;
		system("cls"); // 清屏
		if(dy==1){
			cout<<">传说之下<\n";
			cout<<"确定吗?(y/n)\n";			
			cout<<" 我的世界(敬请期待) \n"; 
			cout<<" (去投稿吧) \n";
			char sed;
			cin>>sed;
			if(sed=='y'){
				dy1(1);
				system("cls"); // 清屏
			}

		}
		if(dy==2){
			cout<<" 传说之下 \n";
			cout<<">我的世界(敬请期待)<\n"; 
			cout<<" (去投稿吧) \n";
		}
	} 
	return 0;
}






加入了怪物系统

更新了更多内容

修复了一些BUG

1 条评论

  • @ 2026-3-31 16:12:50
    #include <bits/stdc++.h>
    #include <fstream>
    #include <string>
    #include <cstdlib>
    #include <ctime>
    #include <iomanip>
    #include <algorithm>
    #include <sstream>
    #include <windows.h>
    #include <vector>
    #include <limits>
    using namespace std;
    vector<int> hui1;
    void dy1(int x){
    	cout<<"开始游戏 (y/n)";
    	char cdy;
    	cin>>cdy;
    	if(cdy=='n') return ;
    	for(int i=1;i<=7;i++) {
    		cout<<"加载中.";
    		Sleep(200);
    		system("cls"); // 清屏
    		cout<<"加载中..";
    		Sleep(210);
    		system("cls"); // 清屏
    		cout<<"加载中...";
    		Sleep(220);
    		system("cls"); // 清屏
    	}
    	cout<<"*你出现";
    	Sleep(80);
    	cout<<"一个";
    	Sleep(83);
    	cout<<"阴森的走廊\n"; 
    	int scd;
    	cout<<"*你现在有两种选择..\n";
    	cout<<" 1.向前走\n";
    	cout<<" 2.推开旁边的房门\n";
    	cin>>scd;
    	if(scd==2){
    		cout<<"*你没有钥匙...dasdfwe^&$dh\n"; 
    		while(scd==2){
    			cout<<"*你现在有两种选择..\n";
    			cout<<" 1.向前走\n";
    			cout<<" 2.推开旁边的房门\n";
    			cin>>scd;
    			if(scd==2){
    				cout<<"*你没有钥匙...\n";
    			} 
    		}
    	}
    	cout<<"*你向前走去...\n";
    	cout<<" 1.靠墙走\n";
    	cout<<" 2.大摇大摆的走过去\n";
    	int kan;
    	cin>>kan;
    	if(kan==2){
    		cout<<"You DIED\n\t死因:掉进陷阱了\n";
    		cout<<"是否回档 ?(1:是, 2:否)";
    		int a; cin>>a;
    		if(a==1){
    			dy1(1);
    		} else  if(a==2){
    			cout<<"感谢游玩,再见";
    			return 0; 
    		}
    	} else if(ken==1){
    		cout<<"你听到了一点动静从房门里传出,是否开门去探险 ?(1:是, 2:否)";
    		int x1; cin>>x1;
    		if(x1==1){
    			cout<<"You DIED\n\t死因:被僵尸杀死\n";
    			cout<<"是否回档 ?(1:是, 2:否)";
    			cin>>a;
    			if(a==1){
    				dy1(1);
    			} else if(a==2){
    				cout<<"感谢游玩,再见";
    				return 0; 
    			}
    		} 
    	}
    	Sleep(28347923); 
    }
    int main() {
    	cout<<"你想干甚么?";
    	int dy=1;
    	for(int i=1;;i++){
    		cout<<"w/s键选择\n";
    		char ws;
    		cin>>ws;
    		if(ws=='s'&&dy<2) dy++;
    		if(ws=='w'&&dy>1) dy--;
    		system("cls"); // 清屏
    		if(dy==1){
    			cout<<">传说之下<\n";
    			cout<<"确定吗?(y/n)\n";			
    			cout<<" 我的世界(敬请期待) \n"; 
    			cout<<" (去投稿吧) \n";
    			char sed;
    			cin>>sed;
    			if(sed=='y'){
    				dy1(1);
    				system("cls"); // 清屏
    			}
    
    		}
    		if(dy==2){
    			cout<<" 传说之下 \n";
    			cout<<">我的世界(敬请期待)<\n"; 
    			cout<<" (去投稿吧) \n";
    		}
    	} 
    	return 0;
    }
    
    • 1