问题标题: 酷町堂:挖矿模拟器 v0.0.1

0
0
已解决
被禁言 高乐彤
高乐彤
修练者
修练者
#include<windows.h>
#include<bits/stdc++.h>
#include <sys/stat.h>
#include <fstream>
#include <unistd.h>
#include <string>
#include <cstdlib>
#include <ctime>
#include <fstream>
int HP=25,FOOL=30,N=15,cg=0,m,fs,e;
using namespace std;
put(string s){
    for(int i=0;i<s.size();i++){
        cout<<s[i];
        Sleep(100);
    }
}
void qk(int x){
    FOOL--;
    if(x==2||x==3||x==1){
        int k=rand()%2;
        if(k==0){
            int r=rand()%50+1;
            if(r<=10){
                int l=rand()%3+1;
                cout<<"你遇到了"<<l<<"只僵尸!";
                    cout<<"生命-"<<l*2;
                cout<<"。同时你花费了"<<l<<"点"<<"饱食度来打僵尸"<<endl;
            }if(r>=11&&r<=15){
                cout<<"你挖到了地雷!"; 
                cout<<"你你扣掉了85%的血!\n";
                HP=(double)(HP*1.00/100.0*15);
            }if(r>=18&&r<=30){
                cout<<"你什么也没挖到\n";
            }if(r>=31&&r<=39){
                cout<<"你被头顶的砂砾埋了,生命-30%\n";
                HP=(double)(HP*1.00/100.0*70);
            }if(r>=40){
                int l=rand()%5;
                cout<<"你挖空了!摔掉了"<<l<<"点血\n"; 
                HP-=l;
                cg-=l;
            }
        }if(k==1){
            int r=rand()%10+1;
            if(r==1){
                int k=rand()%250+100;
                cout<<"你挖到了钻石!卖得"<<k<<"元\n";
                m+=k;
            }if(r>=2&&r<=7){
                int k=rand()%100+30;
                cout<<"你挖到了铁,卖得"<<k<<"元\n";
                m+=k;
            }if(r>=8&&r<=10){
                int k=rand()%150+80;
                cout<<"你挖到了金!卖得"<<k<<"元\n";
                m+=k;
            }
        }
    }
    return ;
}
int main(){
    srand(time(0));
    cout<<"生命:25 饱食度:30 氧气含量:15 海拔:0 钱数:0\n";
    while(HP>0&&FOOL>0&&N>0){
        cout<<"你要:1向下挖 2向左挖 3向右挖 0退出\n";
        int a;
        cin>>a;
        if(a<=3)qk(a);
        if(a==0)return 0;
        Sleep(1000);
        system("cls");
        cout<<"生命:"<<HP<<" 饱食度:"<<FOOL<<" 氧气含量:"<<N<<" 海拔:"<<cg<<" 钱数:"<<m<<endl;
    }
    system("cls");
    cout<<"你**了!"; 
    Sleep(1000);
    cout<<"正在计算分数";
    for(int i=1;i<=3;i++){
        Sleep(250);
        cout<<". ";
    }
    system("cls");
    while(m){
        printf("钱数:%d 分数:%d\n",m,fs);
        m--;
        int k=rand()%3;
        fs+=49+k;
        system("cls");
    }
    system("cls");
    put("你最终的成绩为:");
    cout<<fs; 
    return 0;
}

 


0
1
0
0
0
0
0
0
肖俊宁
肖俊宁
高级守护
高级守护

随便也能几千上万

肖俊宁在2021-09-23 17:10:56追加了内容

统计有点慢

我要回答