屠龙勇士 1.0 内测版本(废):
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string jz[8]= {"▏","▎","▍","▌","▋","▊","▉"},key;
int cj[20],tp,fh,tishi[10],tuichu,s;char c;
void S(string s,int su){
for(int i=0;i<s.size();i++){cout<<s[i];Sleep(su);}
return;
}
void START(){system("cls");S("此区域尚未开发,预计时间:114514.13.32 25h 61m 61s ",30);Sleep(500);return;S("其实是2023.8.15",30);}
void CJ(){system("cls");S("此区域尚未开发,预计时间:114514.13.32 25h 61m 61s ",30);Sleep(500);return;S("其实是2023.8.15",30);}
void cd(){
S("屠龙勇士",30);cout<<"\n";
S("1.开始游戏",30);cout<<"\n";
S("2.查看成就",30);cout<<"\n";
S("3.提示",30);cout<<"\n";
S("4.设置",30);cout<<"\n";
S("5.退出游戏",30);cout<<"\n";
cin>>key;
if(key=="1")START();
if(key=="2")CJ();
if(key=="3"){
srand(time(NULL));
int ts=rand()%10;
system("cls");
switch(ts){
case 0:{S("多退出几遍就能成功!!!",20);break;}
case 1:{S("非正常提示:(交代了作者写题的网站)",30);Sleep(300);
system("start https://www.luogu.com.cn");Sleep(300);break;}
case 2:{S("隐藏提示:有10%几率可以免除死亡",50);break;}
case 3:{S("成就列表中可不止一项哦……",25);break;}
case 4:{S("超级提示:最完美的结局不是100分结局!!!",100);break;}
case 5:{S("非正常提示:这是作者写的第一款游戏!",30);break;}
case 6:{S("你有发现提示也能触发成就的吗?",20);break;}
case 7:{S("游戏分为两种角色:人类、勇士",30);break;}
case 8:{S("非正常提示:这是最废的提示……",30);Sleep(300);
system("start https://www.crazygames.com/");Sleep(300);break;}
case 9:{S("隐藏提示:死亡很多次后……(有个地方可以刷死亡次数)",30);break;}
}
tishi[ts]++;
for(int i=0;i<10;i++){
if(tishi[i]&&i==9){
cout<<"\n";S("恭喜获得成就——尝试(成就2)",20);
cout<<"\n";S("触发条件:看到所有的提示",20);
Sleep(1000);cj[2]++;
}
else if(!tishi[i])break;
}
}
if(key=="4"){
system("cls");
S("你可以调配字体与背景色",30);cout<<"\n";
S("可调配颜色:0黑1蓝2绿3湖蓝4红5紫6黄7白8灰9淡蓝A淡绿B浅绿C淡红D淡紫E淡黄",10);
cout<<"\n";
S("输入两个色号,第一个是字体色,第二个是背景色,以空格隔开",10);cout<<"\n";
string yanse1,yanse2;cin>>yanse1>>yanse2;
if((!isdigit(yanse1[0])&&!(yanse1[0]>='A'&&yanse1[0]<='E'))
||(!isdigit(yanse2[0])&&!(yanse2[0]>='A'&&yanse2[0]<='E'))||
yanse1.size()!=1||yanse2.size()!=1){
MessageBox( 0 , TEXT("目前不能调配此颜色!"),TEXT("重要提示") , MB_ICONWARNING|MB_OK);
Sleep(300);system("cls");cd();}
else if(!cj[1]&&!tp%10&&tp){
S("既然你那么想配置,就给你一个奖励吧。",20);cout<<"\n";
if(tp==10){
S("恭喜获得成就——执着(成就1)",20);
cout<<"\n";S("触发条件:'调配'十次颜色",20);
cj[1]++;
}
else S("复活机会+1",20),fh++;
}
else{S("你永远也别想调配:)",20);tp++;}
cout<<"\n";S("退出中……",1000);system("cls");
}
if(key=="5"){
system("cls");
tuichu++;
if(tuichu%5)S("想退?死吧!",30),s++;
else if(!cj[3]){
S("恭喜获得成就——退出大师(成就3)",20);
cout<<"\n";S("触发条件:退出5次",20);
cj[3]++;tuichu%=5;
}
else{
int r=MessageBox( 0 , TEXT("你确定要退出吗?"),
TEXT("重要提示") , MB_ICONWARNING|MB_YESNO);
switch(r){
case IDYES:{MessageBox(0,TEXT("那我也不拦着你"),TEXT("结束"),MB_OK);exit(0);}
case IDNO:{MessageBox(0,TEXT("看来你还是想玩的吗!"),TEXT("***"),MB_OK);break;}
}
}
}
Sleep(300);system("cls");cd();
}
int main(){
SetConsoleTitle("***——著");
int r=MessageBox( 0 , TEXT("不要输入字符!"),
TEXT("重要提示") , MB_ICONWARNING|MB_YESNO);
switch(r){
case IDNO:{MessageBox(0,TEXT("那你别玩了"),TEXT("结束"),MB_OK);return 0;}
}
MessageBox(0,TEXT("注意!尽量不要退出!因为作者不会存档QWQ"),TEXT("提示"),MB_OK);system("cls");
cd();
//MessageBox( 0 , TEXT("游戏现在开始"),TEXT("重要提示"),MB_OK);
return 0;
}屠龙勇士 2.7 正式版本(翻新,未写完):
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string tfname[10]={"重伤","神级鉴定师","十倍掉落","肉盾","超级强化","全副武装","十倍反伤","大地守护","黑暗侵蚀","雷龙之怒"};
string tfsx[10]={"Common,普通","Myhic,神话","Lengendary,传奇","Usunal,罕见","Ultra,究极","Rare,稀有","Super,超级","Hyper,神级","Epic,史诗","???,未知属性"};
void S(string s,int a){
for(int i=0;i<s.size();i++){cout<<s[i];Sleep(a);}
cout<<"\n";Sleep(a);
}
char ch;
int TF;
string name;
void cq(){
system("cls");
S("即将抽取您的天赋",20);
Sleep(1000);
int x=rand()%110+10;
for(int i=0;i<=x;i++){
system("cls");
S(tfname[i%10],1);
}
S("恭喜您!",10);
Sleep(1000);
system("cls");
x%=10;
S(tfname[x],10);
S(tfsx[x],10);
TF=x;
Sleep(1000);
switch(x){
case 0:{S("效果:攻击永久+10",20);S("描述:前期很厉害,而后期……",20);break;}
case 1:{S("效果:可以使装备提升1星(各属性+50%)",30);S("描述:前后期都不错的天赋",30);break;}
case 2:{S("效果:同介绍",30);S("描述:不错的天赋",30);break;}
case 3:{S("效果:生命永久+1000",20);S("描述:前中期很厉害,而后期……",20);break;}
case 4:{S("效果:装备强化概率为50%(一般为5%)",30);S("描述:前后期都不错的天赋",30);break;}
case 5:{S("效果:攻击永久+10,生命永久+1000,双防永久+100",20);S("描述:前中期很厉害,而后期……",20);break;}
case 6:{S("效果:同介绍",30);S("描述:后期非常好,前中期一般的天赋",30);break;}
case 7:{
S("效果:受到攻击时,可以生成一个超级护盾,护盾双防为自身攻击*3,血量为自身血量*10,破碎后自身血量-30%血量上限",50);
S("描述:非常好的天赋,但是千万不要让护盾碎裂!",50);
break;
}
case 8:{S("效果:每回合敌方血量-10%",20);S("描述:打BOSS必备",20);break;}
case 9:{
S("效果:(*(344))34sefe*(eesdIrisfg(**(%$))Descendants*&%$((*(&^$of((*)(*(&&&789)45336%)",30);
S("描述:##(eser&&Thunder93)#Dragon&^544jjkdChieses5#78*$3CHINESE4&O()%$##^34&&*##&)$%$#",30);
S("再次描述:*&^78transmite398-missile3translate**%78778chinese&*^3)()^%^$$#^$#??hornet?",30);
S("失败.............................................................Bush--ok....../.....",30);
break;
}
break;
}
return;
}
int main(){
srand(time(NULL));SetConsoleTitle("屠龙勇士2");
MessageBox(0,TEXT("欢迎游玩!"),TEXT("欢迎"),MB_OK);
S("这是一个网游类游戏。",10);Sleep(1000);
S("请您认真游玩。",10);Sleep(1000);
S("请选择职业",10);
S("1.战士 2.法师",10);
cin>>ch;
while(ch!='1'&&ch!='2'){
S("请重新输入。",10);
cin>>ch;
}
S("请输入游戏ID:",10);
cin>>name;
system("cls");
S(name+",欢迎!",10);
Sleep(1000);
cq();
return 0;
}九连环 2.0 公测版本(教学只教学一次):
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
char c;bool H[10],jiao=1;int h,s;
void S(string s){
for(int i=0;i<s.size();i++){cout<<s[i];Sleep(10);}
cout<<"\n";Sleep(10);
}
void jlh(){
system("cls");
for(int i=9;i>=1;i--){if(H[i]==0)cout<<"O";else cout<<" ";}
cout<<"\n";
for(int i=9;i>=1;i--){if(H[i]==1)cout<<"O";else cout<<" ";}
cout<<"\n987654321\n\n";
if(jiao)S("输入i就可以把第i个环装上/卸下");
if(jiao)S("比如3就是将第3环装上/卸下");
if(jiao)jiao=0;
cin>>s;
if(s<=0||s>9){S("你确定有这个环?重来!");jlh();return;}
else if(s>1&&H[s-1]){S("NONONO");jlh();return;}
for(int i=s-2;i>=1;i--){if(H[s-1]||!H[i]){S("先了解一下九连环吧!");jlh();return;}}
if(H[s]==0)h++;else h--;H[s]^=1;
if(h==9){S("勇士,恭喜通关!");return;}
else jlh();
}
int main(){
S("是否教学Y/N");
cin>>c;if(c=='N')jiao=0;
system("cls");
S("九连环游戏");
S("***出品^_^");
S("按a开始");
cin>>c;if(c=='a')jlh();
system("cls");
S("感谢游玩!");
return 0;
}微型计算机 1.0 内测版本:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
class operation{
protected:
double ans1;
int a2,b2,ans2;
public:
void input(int a,int b);
void plus(void);
void minus(void);
void mul(void);
double div_and_get(void);
void mod(void);
int get(void);
int get_a(void);
int get_b(void);
};
void operation::input(int a,int b){
a2=a;
b2=b;
return;
}
void operation::plus(void){
ans2=a2+b2;
return;
}
void operation::minus(void){
ans2=a2-b2;
return;
}
void operation::mul(void){
ans2=a2*b2;
return;
}
void operation::mod(void){
ans2=a2%b2;
return;
}
int operation::get(void){
return ans2;
}
int operation::get_a(void){
return a2;
}
int operation::get_b(void){
return b2;
}
double operation::div_and_get(void){
ans1=(double)a2/(double)b2;
return ans1;
}
int main(){
operation A;
A.input(0,0);
int op;
while(1){
printf("迷你计算机\n");
printf("1.输入(整数类型)\n");
printf("2.加\n");
printf("3.减\n");
printf("4.乘\n");
printf("5.除\n");
printf("6.余\n");
printf("7.当前输入\n");
printf("8.退出\n");
cin>>op;
system("cls");
switch(op){
case 1:{
int a,b;
printf("请输入!\n");
scanf("%d%d",&a,&b);
A.input(a,b);
break;
}
case 2:{
A.plus();
printf("加法的结果是:%d + %d = %d\n",A.get_a(),A.get_b(),A.get());
break;
}
case 3:{
A.minus();
printf("减法的结果是:%d - %d = %d\n",A.get_a(),A.get_b(),A.get());
break;
}
case 4:{
A.mul();
printf("乘法的结果是:%d * %d = %d\n",A.get_a(),A.get_b(),A.get());
break;
}
case 5:{
printf("除法的结果是:%d / %d = %.3f",A.get_a(),A.get_b(),A.div_and_get());
break;
}
case 6:{
A.mod();
printf("取余的结果是:%d mod %d = %d",A.get_a(),A.get_b(),A.get());
break;
}
case 7:{
printf("当前输入:%d %d",A.get_a(),A.get_b());
break;
}
case 8:{
printf("感谢您的游玩!\n");
return 0;
}
}
Sleep(500);
system("cls");
}
return 0;
}压行机 1.0 内测版本:
#include<bits/stdc++.h>
using namespace std;
bool only=false;//only #
int zs,pj;//Block annotation;
string line,ans;
bool pd(char ch){
if(isdigit(ch))return true;
if(isalpha(ch))return true;
if(ch=='\\')return true;
if(ch=='_')return true;
return false;
}
void rule(){
while(line[0]==' '||line[0]=='\n')line.erase(0,1);
if(!line.size())return;
if(line[0]=='#'&&!only&&ans.size()&&!pj)ans+='\n';
if(line[0]=='#')only=1;
else if(!zs)only=0;
char last;
for(int i=line.size()-1;i>=0;i--)
if(line[i]!=' '){
last=line[i];
break;
}
for(int i=0;i<line.size();i++){
if(line[i]=='/'){
if(line[i+1]=='/'&&!zs)break;
if(line[i+1]=='*')zs=1;
}
if(line[i]=='*'&&line[i+1]=='/'&&zs){
if(only&&ans[ans.size()-1]!='#')ans+=' ';
zs=0;
i++;
continue;
}
if(zs)continue;
if(line[i]=='\''){
ans+=line[i];i++;
if(i==line.size())break;
while(line[i]!='\''||line[i-1]=='\\'&&line[i-2]!='\\'){
ans+=line[i];
i++;
if(i==line.size())break;
}
if(i==line.size())break;
ans+=line[i];
continue;
}
if(line[i]=='\"'){
ans+=line[i];i++;
if(i==line.size())break;
while(line[i]!='\"'||line[i-1]=='\\'&&line[i-2]!='\\'){
ans+=line[i];
i++;
if(i==line.size())break;
}
if(i==line.size())break;
ans+=line[i];
continue;
}
if(line[i]==' '&&pd(line[i-1])&&pd(line[i+1]))ans+=' ';
else if(line[i]==' '){
line.erase(i,1);
i--;
}
else if(line[i]!=' ')ans+=line[i];
}
if(last=='\\'){
while(ans[ans.size()-1]==' ')ans.erase(ans.size()-1,1);
ans.erase(ans.size()-1,1);
pj=1;
}
if(only&&!zs&&!pj)ans+='\n';
return;
}
int main(){
while(getline(cin,line))rule();
cout<<ans;
return 0;
}
计算机衍生品:
#include<bits/stdc++.h>
using namespace std;
int a,b;
string H(int x){
string t="";
while(x){
t+=x%10+'0';
x/=10;
}
reverse(t.begin(),t.end());
return t;
}
int main(){
scanf("%d/%d",&a,&b);
if(a%b==0){
cout<<a/b;
return 0;
}
int z=a/b;
a-=z*b;
int g=__gcd(a,b);
a/=g;
b/=g;
string Z=H(z);
string A=H(a);
string B=H(b);
int q=Z.size(),h=B.size();
if(Z=="0")q=0;
for(int i=1;i<=q+h-A.size();i++)cout<<" ";
cout<<A<<"\n";
if(Z!="0")cout<<Z;
for(int i=1;i<=h;i++)cout<<"-";
cout<<"\n";
for(int i=1;i<=q;i++)cout<<" ";
cout<<B;
return 0;
}扫雷(转载)
#include <bits/stdc++.h>
#include <windows.h>
#define wait Sleep(1145)
#define po cout<<'.'
#define clear_terminal system("cls");
#define __clear_terminal cout<<"\033[2J\033[1;1H"
#define DIE exit(1)
#define random_start srand(time(NULL))
#define ILoveTheHistoryTeacher true
using namespace std;
const int P = 3;
const int MAXN = 105;
char board_out[MAXN][MAXN];
int board_dev[MAXN][MAXN];
//bool board_status[MAXN][MAXN];
int game_starter, mines, now_mines, die_mines = 0, flags, board_size_linear, board_size_square, board_size_square_half;
char c;
int x, y;
struct player_node {
int px, py;
} PN;
void wait_use() {
for (int i = 1; i <= P; i++) {
po;
wait;
}
}
void __execute() {
cout << "你似乎听不清楚人话" << '\n';
wait;
wait;
cout << "该罚!!!" << '\n';
exit(1);
}
int main() {
random_start;
clear_terminal;
cout << "郑重声明:此游戏由songyd(kszsongyundi)与A_W_Lee(kszlizhengrui)联合制作,严禁盗版" << '\n';
wait;
wait;
wait;
clear_terminal;
wait_use();
clear_terminal;
cout << "扫雷游戏经典版(禁止任何非法操作)" << '\n' << "输入'1'以开始" << '\n';
cin >> game_starter;
if (game_starter != 1)
__execute();
clear_terminal;
wait_use();
clear_terminal;
cout << "输入一个整数,代表你希望在几乘几的棋盘上进行游戏(2<n<101)" << '\n';
cin >> board_size_linear;
board_size_square = pow(board_size_linear, 2);
board_size_square_half = board_size_square / 2 + 1;
if (board_size_linear<2 or board_size_linear>100)
__execute();
clear_terminal;
wait_use();
clear_terminal;
for (int I = 1; I <= board_size_linear; I++) {
for (int J = 1; J <= board_size_linear; J++) {
board_dev[I][J] = 0;
}
}
cout << "你希望有几颗雷(大于0且小于总格子数的一半)" << '\n';
cin >> mines;
flags = mines, now_mines = mines;
if (mines<1 or mines>board_size_square_half)
__execute();
clear_terminal;
wait_use();
random_start;
while (ILoveTheHistoryTeacher) {
if (now_mines < 1)
break;
x = rand() % 100 + 1;
y = rand() % 100 + 1;
//cout<<x<<' '<<y<<'\n';
//while(board_dev[N.x][N.y]==-1) N.x=rand()%1+board_size_linear,N.y=rand()%1+board_size_linear;
if (board_dev[x][y] == 0 and x <= board_size_linear and y <= board_size_linear) {
now_mines--;
board_dev[x][y] = -1; //the mine put
if (now_mines < 1)
break;
} else {
x = rand() % 1 + board_size_linear;
y = rand() % 1 + board_size_linear;
}
}
clear_terminal;
//count_mines
for (int i = 1; i <= board_size_linear; i++) {
for (int j = 1; j <= board_size_linear; j++) {
if (board_dev[i][j] == -1)
continue;//this is a mine
//every area mines cnt
else {
if (board_dev[i - 1][j - 1] == -1)
board_dev[i][j]++;
if (board_dev[i - 1][j] == -1)
board_dev[i][j]++;
if (board_dev[i - 1][j + 1] == -1)
board_dev[i][j]++;
if (board_dev[i][j - 1] == -1)
board_dev[i][j]++;
if (board_dev[i][j + 1] == -1)
board_dev[i][j]++;
if (board_dev[i + 1][j - 1] == -1)
board_dev[i][j]++;
if (board_dev[i + 1][j] == -1)
board_dev[i][j]++;
if (board_dev[i + 1][j + 1] == -1)
board_dev[i][j]++;
}
}
}
//areas starter
for (int i = 1; i <= board_size_linear; i++) {
for (int j = 1; j <= board_size_linear; j++) {
board_out[i][j] = '*';
}
}
//the game is start
while (ILoveTheHistoryTeacher) {
clear_terminal;
for (int i = 1; i <= board_size_linear; i++) {
for (int j = 1; j <= board_size_linear; j++) {
cout << board_out[i][j];
}
cout << '\n';
}
cout << "剩余旗帜数:" << flags << '\n';
cout << "公猪请操作(翻开:a;插旗:b;拔旗:c;)" << '\n';
cin >> c;
if (c != 'a' and c != 'b' and c != 'c') {
cout << "..." << '\n';
wait;
exit(0);
} else {
cout << "请输入坐标" << '\n';
if (c == 'a') {
cin >> PN.px >> PN.py;
wait_use();
if (board_dev[PN.px][PN.py] == -1) { //mine
cout << '\n' << "恭喜你挖到了一个地雷" << '\n';
wait;
cout << "去见蒋子文爷爷吧!!!" << '\n';
wait;
//return 0;
exit(1);
} else {
board_out[PN.px][PN.py] = board_dev[PN.px][PN.py] + '0';
//I don't believe in endless enumeration
for (int __I = 1; __I <= board_size_linear; __I++) {
for (int I = 1; I <= board_size_linear; I++) {
for (int J = 1; J <= board_size_linear; J++) {
if (board_out[I][J] == '0') {
board_out[I - 1][J - 1] = board_dev[I - 1][J - 1] + '0';
board_out[I - 1][J] = board_dev[I - 1][J] + '0';
board_out[I - 1][J + 1] = board_dev[I - 1][J + 1] + '0';
board_out[I][J - 1] = board_dev[I][J - 1] + '0';
board_out[I][J + 1] = board_dev[I][J + 1] + '0';
board_out[I + 1][J - 1] = board_dev[I + 1][J - 1] + '0';
board_out[I + 1][J] = board_dev[I + 1][J] + '0';
board_out[I + 1][J + 1] = board_dev[I + 1][J + 1] + '0';
}
}
}
}
clear_terminal;
}
}
if (c == 'b') {
cin >> PN.px >> PN.py;
wait_use();
if (flags == 0) {
cout << "八嘎!没旗了还想插想见蒋子文爷爷了是不是" << '\n';
wait;
exit(1);
}
if (board_out[PN.px][PN.py] != '*') {
cout << "八嘎!在已经翻过的上面插旗想见蒋子文爷爷了是不是" << '\n';
wait;
return 0;
}
if (board_dev[PN.px][PN.py] == -1) {
die_mines++;
}
board_out[PN.px][PN.py] = 'f';
flags--;
}
if (c == 'c') {
cin >> PN.px >> PN.py;
wait_use();
if (board_out[PN.px][PN.py] != 'f') {
cout << "八嘎!在没插过旗的上面拔旗想见蒋子文爷爷了是不是" << '\n';
wait;
exit(1);
}
if (board_dev[PN.px][PN.py] == -1) {
die_mines--;
}
board_out[PN.px][PN.py] = '*';
flags++;
}
clear_terminal;
if (die_mines == mines) {
clear_terminal;
wait_use();
cout << '\n' << "你标记了所有地雷" << '\n';
cout << "/033";
system("color 0e");
cout << "你过关";
system("color 0f");
cout << "/033";
wait;
exit(1);
}
}
}
return 0;
}