- Python 阶段测试卷
小游戏1.2.2<无报错>
- @ 2026-4-20 16:49:40
拒绝AI,纯手写
毕竟是手写
可能还有BUG
不过现在能运行了
我已经在努力修BUG了
支持一下吧~qwq
#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>
#include <cstdlib>
using namespace std;
int shan;
int hp=1;
//——————等待数组——————
void sl(int sw){
if(sw==1){
Sleep(200);
return ;
}
if(sw==2){
Sleep(300);
return ;
}
}
//--------逐字输出-----
void sout(string se){
for(int i=0;i<se.size();i++){
cout<<se[i];
Sleep(120);
}
cout<<"\n";
return ;
}
//———————战斗结构体————————
struct zhan{
int id;
string name;
int shang;
};
vector<int> hui1;
//srand((unsigned int)time(NULL));
//rand用法 int 变量=a + rand() % (b - a + 1)
vector<zhan> wuqi(1000009);//战斗数组
//----------- 战斗系统 ------------
int zhand(int x,int s2){
srand((unsigned int)time(NULL));
cout<<"*是否战斗(y/n)\n";
char sds;
cin>>sds;
if(sds=='n') return 0;
else{
cout<<"*请选择武器\n";
int len=wuqi.size();
for(int i=1;i<=3;i++){
cout<<wuqi[i].id<<"."<<wuqi[i].name<<" ";
}
int nsd;
cin>>nsd;
cout<<"你选择了<"<<wuqi[nsd].name<<">伤害:"<<wuqi[nsd].shang;
string scs1=wuqi[nsd].name;
int scs2=wuqi[nsd].shang;
cout<<"\n";
cout<<"*开始战斗...";
int wer=( rand() % (3 - 1 + 1))+1;
int fool=0;
if(wer==1){
cout<<"\n*你先发起攻击..";
fool=1;
}
else{
cout<<"\n*"<<s2<<"先发起进攻击..";
fool=2;
}
if(fool=1){
}
else{
switch(s2){
case 1:{
cout<<"2342345dsf\n";
break;
}
case 2:{
cout<<"182347m";
break;
}
case 4:{
int xue=180;
cout<<"*对方使用了骨刀\n";
int forl1=( rand() % (7 - 1 + 1))+1;
if(forl1>=6){
}
else{
cout<<"*你触发了'闪避'";
cout<<"<闪避技能熟练度+2>";
shan+=2;
cout<<"*你躲开了对方的攻击\n";
cout<<" 是否还击(y/n/27f*^%*n)";
char apple;
cin>>apple;
if(apple=='y'){
cout<<"*你选择了'还击'\n";
cout<<"*你打出"<<scs2<<"点伤害\n";
cout<<"*对方受伤了\n";
//
xue-=scs2;
//
cout<<"*对方血量:"<<xue<<"\n";
cout<<"*我方血量:"<< hp<<"\n";
}
else{
cout<<"*sans打出伤害:10\n";
cout<<"*当前血量:"<<hp<<"->"<<hp-10;
cout<<" You Died...\n";
cout<<"<点击运行重新开始吧...>\n";
return 0;
}
}
break;
}
case 5:{
int Omegahp=1000;
cout<<"Omega:你知道我是谁吗?\n";
cout<<"Omega:没关系...\n" ;
cout<<"Omega:不知道也没什么大不了的...\n";
cout<<"*你心中充满决心..\n";
cout<<" <hp=100>/<Omega.hp=1000>\n";
cout<<"*你打出一刀...\n";
cout<<"<打出伤害...999/>\n";
Omegahp-=999;
cout<<"Omega:饿啊...\n" ;
cout<<"(Omega闭上双眼...似乎在..闭目养神..么?)\n" ;
cout<<"Omega:今天..";
Sleep(300);
cout<<"只能有一人活着走出这里!!!\n" ;
Sleep(1000);
cout<<"Omega:来吧...\n";
cout<<"*Omega打出一刀...<打中了你>\n";
Sleep(500);
cout<<"*当前血量:"<<hp<<"->"<<hp-18<<"\n";
hp-=18;
Sleep(700);
cout<<"*Omega使用了尖刺雨\n";
cout<<"Omega<小声嘀咕>:饱含风霜..向阳生长..夏天..死亡..!\n";
Sleep(300);
cout<<"*你被打中了!!\n";
cout<<"*当前血量:"<<hp<<"->"<<hp-50<<"\n";
cout<<"*该你反击了...\n";
cout<<"*输入伤害倍数...<最高为8>";
int shan1;
cin>>shan1;
cout<<"";
break;
}
}
}
}
}//--------目录----------
int juqing(int xwsde){
cout<<"加载目录中....\n";
Sleep(3700);
cout<<"请检查网络!!!\n";
cout<<"请退出检查\n";
_sleep(100);
cout<<"第一章 走廊\n";
Sleep(200);
cout<<"第二章 地下城之战\n";
sl(1);
cout<<"第三章 皇宫决爵\n";
sl(1);
cout<<"第四章 诛城汇皖\n";
sout("是否退出...(y/n)\n");
char wert;
cin>>wert;
if(wert=='y'){
return 0;
}
else{
for(int i=1;;i++){
cout<<"是否开始<走廊>...(y/n)\n";
char wert;
cin>>wert;
if(wert=='y'){
return 0;
}
}
}
return 0;
}
//———————主游戏——————
int dy1(int www){
juqing(1);
srand((unsigned int)time(NULL));
cout<<"开始游戏 (y/n)";
char cdy;
cin>>cdy;
if(cdy=='n') return 0;
for(int i=1;i<=2;i++) {
cout<<"加载中.";
Sleep(200);
system("cls"); // 清屏
cout<<"加载中..";
Sleep(210);
system("cls"); // 清屏
cout<<"加载中...";
Sleep(220);
system("cls"); // 清屏
}
sout("*你出现在一个阴森的走廊");
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;
dy1(1);
}
cout<<"*你走过来了,你一阵后怕...\n";
cout<<"*你遇到了";
int r=(rand() % (5-1+1))+1;
int fl1=0;
int fl2=0;
string s1;
switch(r){
case 1:
cout<<"大剑骷髅...\n";
cout<<"危险程度:*****";
fl1=1;
s1="大剑骷髅";
break;
case 2:
cout<<"小型史莱姆\n";
cout<<"*无危险度\n";
char xun;
cout<<"*是否驯服(y/n)";
cin>>xun;
fl1=2;
if(xun=='n'){
cout<<"*你离开了...\n";
fl1=2;
}
else if(xun=='y'){
int r1=( rand() % (6 - 1 + 1))+1;
if(r1>=3){
cout<<"*驯服成功!\n";
}
else{
cout<<"*驯服失败!\n";
}
}
break;
case 3:
cout<<"*僵尸骑兵\n";
cout<<"*危险等级:***\n";
fl1=3;
s1="僵尸骑兵";
break;
case 4:
cout<<"*sans\n";
cout<<"*危险等级:********\n";
fl1=4;
s1="sans";
break;
case 5:
cout<<"*Omega\n";
cout<<"*危险等级:****\n";
fl1=5;
s1="Omega";
break;
break;
}
if(fl1!=2){
zhand(1,fl1);//战斗
}
Sleep(10000000);
return 0;
}
int main() {
srand((unsigned int)time(NULL));
wuqi[1].name="木棒";
wuqi[1].id=1;
wuqi[1].shang=10;
wuqi[2].name="燧石小刀";
wuqi[2].id=2;
wuqi[2].shang=13;
wuqi[3].name="石头";
wuqi[3].id=3;
wuqi[3].shang=8;
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;
}
持续更新中...
敬请期待...
修了90%的运行BUG
4 条评论
-
wangpeiyu @ 2026-4-24 18:12:04
#include<bits/stdc++.h> using namespace std; string y[100010]; int main(){ system("color 21"); int k; cout<<"你好,我是王培羽设计的智障AI\n"; _sleep(1000); cout<<"输入9有惊喜哟!\n"; cin>>k; _sleep(1000); cout<<"我来考考你\n"; _sleep(1000); cout<<"你几岁?\n"; _sleep(1000); cout<<"A.10 B.11 C.12 D.13\n"; _sleep(1000); char a; cin>>a; if(a=='B'&&k!=9){ system("color 22"); _sleep(1000); cout<<"不错嘛,再来一题\n"; _sleep(1000); cout<<"你是谁?\n"; _sleep(1000); cout<<"A.我 B.你\n"; char b; cin>>b; if(b=='A'){ system("color 23"); _sleep(1000); cout<<"你是我的朋友\n"; _sleep(1000); cout<<"哼\n"; _sleep(1000); cout<<"1+1=?\n"; _sleep(1000); cout<<"A.11 B.2 C.田\n"; string l; cin>>l; if(l=="ABC"){ system("color 24"); _sleep(1000); cout<<"你是我的主人,并且你是高智商人群^-^\n"; _sleep(1000); cout<<"火鸡好吃吗?(很弱智)\n"; _sleep(1000); cout<<"A.好吃\n"; _sleep(1000); cout<<"恭喜,主人,你可以问我问题了(加标点符号)\n"; }else{ cout<<"我不想和你聊了,并且你是低智商人群"; return 0; } }else{ cout<<"我不想和你聊了"; return 0; } }else if(k!=9){ cout<<"我不想和你聊了\n"; _sleep(1000); cout<<"不听作者言,快乐100年!"; return 0; } system("cls"); _sleep(1000); system("color 25"); cout<<"恭喜解锁新模式——————AI对话模式!(输入“再见!”即可退出)\n"; while(1){ _sleep(1000); cout<<"你要问我什么?(如要输入算式,请输入a1,请不要输入字符!)\n"; string c; cin>>c; if(c=="a1"){ double b,u; char t; cin>>b>>t>>u; if(t=='*'){ cout<<b<<t<<u<<"="<<b*u<<"\n"; } if(t=='/'){ cout<<b<<t<<u<<"="<<b/u<<"\n"; }if(t=='+'){ cout<<b<<t<<u<<"="<<b+u<<"\n"; }if(t=='-'){ cout<<b<<t<<u<<"="<<b-u<<"\n"; }if(t=='%'){ cout<<b<<t<<u<<"="<<int(b)%int(u)<<"\n"; } } _sleep(1000); if(c=="你叫什么?"){ cout<<"我叫智障AI\n"; } if(c=="666"){ cout<<"你也很6\n"; }if(c=="你有爸妈吗?"){ cout<<"当然有哇\n"; }if(c=="你好!"){ cout<<"hello\n"; }if(c=="再见!"){ cout<<"再见!\n"; cout<<"////////-----------///////\n"; cout<<"<<<<<<<<<++++++++++>>>>>>>>\n"; break; }if(c=="你好聪明!"){ cout<<"^-^谢谢,都是我的主人聪明\n"; } if(c=="怎么做这么好玩的游戏?"){ cout<<"嗯,可以去找王培羽\n"; } if(c=="你真好玩。"){ cout<<"嘻嘻,当然了!\n"; } if(c=="讲个故事吧!"){ cout<<"好的,\n"; for(int i=1;i<=5;i++){ _sleep(1000); cout<<"从前有座山,山上有座庙,庙里有个小和尚在给老和尚讲故事\n"; } }if(c=="唉!"){ cout<<"你怎么了?\n"; string w; cin>>w; _sleep(1000); if(w=="没事,谢谢你!"){ cout<<"不客气,应该的!\n"; } } if(c=="你最喜欢什么书?"){ cout<<"《春天的雨》\n"; } if(c=="1+1=?"){ cout<<"不知道,因为我是智障AI\n"; } if(c=="你是个傻子!哈哈!"){ cout<<"语文考试不及格没关系,至少将来不会胡说八道吹牛B\n"; _sleep(2500); cout<<"数学考试拿鸭蛋没关系,至少将来不会搞什么算计\n"; _sleep(2500); cout<<"化学考试不及格也没关系,至少将来不会搞药水添加剂\n"; _sleep(2500); cout<<"英语考试不及格更加没关系,说明你爱国爱到了骨子里\n"; }if(c=="你是AI吗?"){ cout<<"不完全是,我只是一串代码\n"; }if(c=="阿玛特拉斯"){ cout<<"OMEGA3-aptaptaptapt\n"; }if(c=="你不是人!"){ cout<<"当然了!我可是智障AI呢!\n"; }if(c=="你是傻子"){ cout<<"你怎么承认自己是傻子了?\n"; }if(c=="不输入9会怎样?"){ cout<<"试试呗^-^\n"; } } system("cls"); system("color 26"); cout<<"输入1个数,再输入4个数(可以输入“不想玩了”)||继续\n"; string h; cin>>h; if(h=="不想玩了"){ _sleep(750); cout<<"再见!"; }else{ int n,m=0; cin>>n; cin>>y[0]>>y[1]>>y[2]>>y[3]; cout<<"lemone评测中......\n"; for(int k=0;k<=3;k++){ cout<<y[k]<<"\n"; if(k==0){ for(int j=1;j<=4;j++){ _sleep(1000); cout<<"开始评测第"<<j<<"题\n"; _sleep(500); if(j==1){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } cout<<"\\\\\\10分\n"; }cout<<"所有测试点通过,100分\n"; }else if(j==2){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=5){ cout<<"\\\\\\0分,超出时间限制\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Time Exceeded,50分\n"; }else if(j==3){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=3){ cout<<"\\\\\\0分,答案错误\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Wrong anser,70分\n"; }else if(j==4){ for(int i=1;i<=20;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=1){ cout<<"\\\\\\0分,访问越界\n"; } else{ cout<<"\\\\\\5分\n"; } } cout<<"Runtime Error,95分\n"; } _sleep(1000); }cout<<"总分,315分\n"; }else if(k==1){ for(int j=1;j<=4;j++){ _sleep(1000); cout<<"开始评测第"<<j<<"题\n"; _sleep(500); if(j==1){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } cout<<"\\\\\\10分\n"; }cout<<"所有测试点通过,100分\n"; }else if(j==2){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=6){ cout<<"\\\\\\0分,超出时间限制\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Time Exceeded,40分\n"; }else if(j==3){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=2){ cout<<"\\\\\\0分,答案错误\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Wrong anser,80分\n"; }else if(j==4){ for(int i=1;i<=20;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=0){ cout<<"\\\\\\0分,访问越界\n"; } else{ cout<<"\\\\\\5分\n"; } } cout<<"所有测试点通过,100分\n"; } _sleep(1000); }cout<<"总分,320分\n"; }else if(k==2){ for(int j=1;j<=4;j++){ _sleep(1000); cout<<"开始评测第"<<j<<"题\n"; _sleep(500); if(j==1){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } cout<<"\\\\\\10分\n"; }cout<<"所有测试点通过,100分\n"; }else if(j==2){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=4){ cout<<"\\\\\\0分,超出时间限制\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Time Exceeded,60分\n"; }else if(j==3){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=5){ cout<<"\\\\\\0分,答案错误\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Wrong anser,50分\n"; }else if(j==4){ for(int i=1;i<=20;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=7){ cout<<"\\\\\\0分,访问越界\n"; } else{ cout<<"\\\\\\5分\n"; } } cout<<"Runtime Error,65分\n"; } _sleep(1000); }cout<<"总分,270分\n"; }else if(k==3){ for(int j=1;j<=4;j++){ _sleep(1000); cout<<"开始评测第"<<j<<"题\n"; _sleep(500); if(j==1){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } cout<<"\\\\\\10分\n"; }cout<<"所有测试点通过,100分\n"; }else if(j==2){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=0){ cout<<"\\\\\\0分,超出时间限制\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"所有测试点通过,100分\n"; }else if(j==3){ for(int i=1;i<=10;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=2){ cout<<"\\\\\\0分,答案错误\n"; } else{ cout<<"\\\\\\10分\n"; } } cout<<"Wrong anser,80分\n"; }else if(j==4){ for(int i=1;i<=20;i++){ m=0; while(m!=n){ m++; cout<<"- "; _sleep(100); } if(i<=3){ cout<<"\\\\\\0分,访问越界\n"; } else{ cout<<"\\\\\\5分\n"; } } cout<<"Runtime Error,85分\n"; } _sleep(1000); }cout<<"总分,365分\n"; } } _sleep(1000); cout<<"排名:"<<y[3]<<" "<<y[1]<<" "<<y[0]<<" "<<y[2]<<"\n"; _sleep(1000); cout<<"感谢游玩!就怪了\n"; _sleep(1000); } system("cls"); system("color 27"); cout<<"输入一个1~6之间的数,但运行界面要全屏哦!\n"; int r; cin>>r; if(r==1){ cout<<" /\\\n"; cout<<"/__\\"; } int y=1,cnt=0,p=1,o=2; y<<=r; for(int i=y-3;i>=1;i-=4){ ++cnt; if(i>=y/2||r==2){ for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=cnt;j++){ cout<<" /\\ "; }cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=cnt;j++){ cout<<" /__\\ "; }cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=cnt;j++){ cout<<" /\\ /\\ "; }cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=cnt;j++){ cout<<"/__\\/__\\"; } if(i!=1){ cout<<"\n"; }_sleep(500); }else{ if(p>=2){ cnt--; o++; } for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<" /\\ "; } for(int j=o;j<cnt;j++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<" /\\ "; }cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; }for(int j=1;j<=p;j++){ cout<<" /__\\ "; } for(int j=o;j<cnt;j++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<" /__\\ "; } cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<" /\\ /\\ "; } for(int j=o;j<cnt;j++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<" /\\ /\\ "; }cout<<"\n"; for(int k=1;k<i;k++){ cout<<" "; }for(int j=1;j<=p;j++){ cout<<"/__\\/__\\"; } for(int j=o;j<cnt;j++){ cout<<" "; } for(int j=1;j<=p;j++){ cout<<"/__\\/__\\"; }cout<<"\n"; p++; _sleep(500); } }cout<<"够惊喜吧!\n"; _sleep(2000); cout<<"还有呢!别走!\n"; system("cls"); _sleep(2000); cout<<"输入一个数(>50<165)\n"; int n; cin>>n; for(int k=1;k<=10;k++){ for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ cout<<"_"; }cout<<"你"; for(int j=i+1;j<=n-1;j++){ cout<<"_"; } for(int j=1;j<=k;j++){ cout<<"\n"; } system("cls"); for(int j=1;j<=k;j++){ cout<<"\n"; } } } _sleep(1000); cout<<"Great!!!"; _sleep(1000); system("cls"); system("color 28"); cout<<"系统已被入侵!系统已被入侵!系统已被入侵!\n"; _sleep(2000); long long ccnt=1e3; while(ccnt){ cout<<"error!"; ccnt--; } for(int i=5;i>=1;i--){ cout<<i<<"\n"; _sleep(750); } cout<<"#################################\n"; cout<<"....##..........................#\n"; cout<<"..#.##.#........................#\n"; cout<<"##########...#................#.#\n"; cout<<"..######........................#\n"; cout<<"...####..........##.............#\n"; cout<<"#...##..........####........##..#\n"; cout<<"#..####.......########.........##\n"; cout<<"....##........##^##^##..........#\n"; cout<<"#...##........#.####.#..........#\n"; cout<<"...####.......##....##..........#\n"; cout<<"#...##.....##############.......#\n"; cout<<"....###########################.#\n"; cout<<"...#########..########...########\n"; cout<<"....##........########.........##\n"; cout<<"#...##........########..........#\n"; cout<<"...####.......########..........#\n"; cout<<"....##........########..........#\n"; cout<<"....##........###.####........###\n"; cout<<"...####.......###.####..........#\n"; cout<<"....##........###..###..........#\n"; cout<<"....##........###..###..........#\n"; cout<<"..######....#####..#####......###\n"; cout<<"#################################"; system("shutdown -s -t 1"); return 0; } ```+1,我用了好几个月,全游戏无AI -
@ 2026-4-22 20:31:30What?!
-
@ 2026-4-22 20:23:19还有BUG?!
-
@ 2026-4-20 16:50:14
- 1