跳到正文

个人记录

抽卡小程序1.6

_jiuye_约 18 分钟
原文
文章信息与版本

文章信息

发布
2023年12月23日
收录
2026年6月23日
更新
2026年11月18日
篇幅
约 18 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int bd,up,s,a;
bool uppf[100],wpf[100],spf[100];
void sc(string n)
{
    for(int i=0;i<n.size();i++)
    {
        cout<<n[i];
        Sleep(10);
    }
    puts("");
    Sleep(15);
}
void open()
{
    ifstream in("ysck.txt");
    in>>bd;
    in>>up;
    in>>s;
    in>>a;
    for(int i=0;i<100;i++) in>>uppf[i];
    for(int i=0;i<100;i++) in>>wpf[i];
    for(int i=0;i<100;i++) in>>spf[i];
    in.close();
}
void cclose()
{
    ofstream out("ysck.txt");
    out<<bd<<" ";
	out<<up<<" ";
	out<<s<<" ";
	out<<a<<" ";
    for(int i=0;i<100;i++) out<<uppf[i]<<" ";
    for(int i=0;i<100;i++) out<<wpf[i]<<" ";
}
int main()
{
	open();
	system("color F0");
    int n,x;
    char t;
    bool flag=true;
    srand(time(0));
    while(flag)
    {
		cout<<"你好!\n我是您的抽卡小助手,接下来是抽卡的一些小规则\n\n";
        cout<<"**************************************\n";
        cout<<"* 1.卡池分为新手池和UP池,本次UP为尘 *\n";
        cout<<"* 世闲游——钟离、无暇之人——爱莉希 *\n";
        cout<<"* 雅,五星(S级)陪跑为迪锅巴、小提,四 *\n";
        cout<<"* 星(A级)陪跑若干,九十抽小保底,一百 *\n";
        cout<<"* 八十抽大保底。                     *\n";
        cout<<"* 注:按a一抽,按s十连,0退出          *\n";
        cout<<"* 五星出率:%2   UP出率(已出五星):%10 *\n";
        cout<<"**************************************\n";
        cin>>t;
        if(t=='a')
        {
            if(bd==180)
            {
                s++;
                x=rand()%10;
                if(x>0&&x<6)
                {
                    cout<<"获得——爱莉希雅!\n";
                    uppf[0]=1;
                    up++;
                }
                else
                {
                    cout<<"获得——钟离!\n";
                    uppf[1]=1;
                    up++;
                }
                bd=0;
            }
            if(bd==90)
            {
                s++;
                x=rand()%100;
                if(x>11&&x<17||x==99||x==43||x>=50&&x<=53)
                {
                    x=rand()%10;
                    if(x>0&&x<6)
                    {
                        cout<<"获得——爱莉希雅!\n";
                        uppf[0]=1;
                        up++;
                    }
                    else
                    {
                        cout<<"获得——钟离!\n";
                        uppf[1]=1;
                        up++;
                    }
                    bd=0;
                }
                else
                {
                    x=rand()%10;
                    if(x==1||x==5||x==2||x==10||x==7)
                        cout<<"获得——迪卢克!\n",wpf[0]=1;
                    else
						cout<<"获得——提纳里!\n",wpf[1]=1;
                }
            }
            x=rand()%1000;
            if(x>=11&&x<=21||x>=597&&x<=607)//五星 
            {
                s++;
                x=rand()%100;
                if(x>11&&x<17||x==99||x==43||x>=50&&x<=53)
                {
                    x=rand()%10;
                    if(x>0&&x<6)
                    {
                        cout<<"获得——爱莉希雅!\n";
                        uppf[0]=1;
                        up++;
                    }
                    else
                    {
                        cout<<"获得——钟离!\n";
                        uppf[1]=1;
                        up++;
                    }
                    bd=0;
                }
                else
                {
                    x=rand()%10;
                    if(x==1||x==5||x==2||x==10||x==7)
                        cout<<"获得——迪卢克!\n",wpf[0]=1;
                    else
                        cout<<"获得——提纳里!\n",wpf[1]=1;
                }
            }
            else
            {
                x=rand()%100;
                if(x>=22&&x<=66)
                {
                    x=rand()%100;
                     if(x>=1&&x<=20) cout<<"获得——云堇!\n",spf[0]=1;
                    else if(x>=21&&x<=40) cout<<"获得——班尼特!\n",spf[1]=1;
                    else if(x>=41&&x<=60) cout<<"获得——行秋!\n",spf[2]=1;
                    else if(x>=61&&x<=80) cout<<"获得——久岐忍!\n",spf[3]=1;
                    else if(x>=81&&x<=100) cout<<"获得——香菱!\n",spf[4]=1;
                    a++;
                }
                else
                    cout<<"依托答辩\n";
                bd++;
            }
        }
        if(t=='0')
            break;
        if(t=='s')
        {
            for(int i=1;i<=10;i++)
            {

                if(bd==180)
                {
                    s++;
                    x=rand()%10;
                    if(x>0&&x<6)
                    {
                        cout<<"获得——爱莉希雅!\n";
                        uppf[0]=1;
                        up++;
                    }
                    else
                    {
                        cout<<"获得——钟离!\n";
                        uppf[1]=1;
                        up++;
                    }
                    bd=0;
                }
                if(bd==90)
                {
                    s++;
                    x=rand()%100;
                    if(x>11&&x<17||x==99||x==43||x>=50&&x<=53)
                    {
                        x=rand()%10;
                        if(x>0&&x<6)
                        {
                            cout<<"获得——爱莉希雅!\n";
                            uppf[0]=1;
                            up++;
                        }
                        else
                        {
                            cout<<"获得——钟离!\n";
                            uppf[1]=1;
                            up++;
                        }
                    }
                    else
                    {
                        x=rand()%10;
                        if(x==1||x==5||x==2||x==10||x==7)
                            cout<<"获得——迪卢克!\n",wpf[0]=1;
                        else
                            cout<<"获得——提纳里!\n",wpf[1]=1;
                    }
                }
                x=rand()%1000;
                if(x>=11&&x<=21||x>=597&&x<=607)//五星 
                {
                    s++;
                    x=rand()%100;
                    if(x>11&&x<17||x==99||x==43||x>=50&&x<=53)
                    {
                        x=rand()%10;
                        if(x>0&&x<6)
                        {
                            cout<<"获得——爱莉希雅!\n";
                            uppf[0]=1;
                            up++;
                        }
                        else
                        {
                            cout<<"获得——钟离!\n";
                            uppf[1]=1;
                            up++;
                        }
                    }
                    else
                    {
                        x=rand()%10;
                        if(x==1||x==5||x==2||x==10||x==7)
                            cout<<"获得——迪卢克!\n",wpf[0]=1;
                        else
                            cout<<"获得——提纳里!\n",wpf[1]=1;
                        bd++;
                    }
                }
                else
                {
                    x=rand()%100;
                    if(x>=22&&x<=66)
                    {
                        x=rand()%100;
                        if(x>=1&&x<=20) cout<<"获得——云堇!\n",spf[0]=1;
                        else if(x>=21&&x<=40) cout<<"获得——班尼特!\n",spf[1]=1;
                        else if(x>=41&&x<=60) cout<<"获得——行秋!\n",spf[2]=1;
                        else if(x>=61&&x<=80) cout<<"获得——久岐忍!\n",spf[3]=1;
                        else if(x>=81&&x<=100) cout<<"获得——香菱!\n",spf[4]=1;
                        a++;
                    }
                    else
                        cout<<"依托答辩\n";
                    bd++;
                }
            }
        }
        if(s>99){
        	s=100;
        	cout<<"目前五星99+个 ";
		}
		else cout<<"目前五星"<<s<<"个 UP";
		if(up>99){
			up=100;
			cout<<"99+个 四星";
		}
		else cout<<up<<"个 四星";
		if(a>99){
			a=100;
			cout<<"99+个 距离大保底还有";
		}
		else cout<<a<<"个 距离大保底还有";
        cout<<180-bd<<"次\n";
        if(t=='b')
        {
        	int y=1;
        	for(int i=0;i<12;i++)
        	{
        		switch(i)
        		{
        			case 0:if(uppf[0])cout<<y<<'.',sc("爱莉希雅"),y++;break;
        			case 1:if(uppf[1])cout<<y<<'.',sc("钟离"),y++;break;
        			case 2:if(uppf[2])cout<<y<<'.',sc("温迪"),y++;break;
        			case 3:if(uppf[3])cout<<y<<'.',sc("魈"),y++;break;
        			case 4:if(wpf[0])cout<<y<<'.',sc("迪卢克"),y++;break;
        			case 5:if(wpf[1])cout<<y<<'.',sc("提纳里"),y++;break;
        			case 6:if(wpf[2])cout<<y<<'.',sc("琴团长"),y++;break;
        			case 7:if(spf[0])cout<<y<<'.',sc("云堇"),y++;break;
        			case 8:if(spf[1])cout<<y<<'.',sc("班尼特"),y++;break;
        			case 9:if(spf[2])cout<<y<<'.',sc("行秋"),y++;break;
        			case 10:if(spf[3])cout<<y<<'.',sc("久岐忍"),y++;break;
        			case 11:if(spf[4])cout<<y<<'.',sc("香菱"),y++;break;
				}
			}
		}
    	cclose();
        Sleep(2000);
        system("cls");
    }
}
原文