跳到正文

个人记录

Card Game

jypo_wont_lose约 6 分钟
原文

这是 2026年11月13日 存档的第 1 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2026年11月13日
收录
2026年11月13日
更新
2026年11月21日
篇幅
约 6 分钟

版本

  1. v2当前
  2. v1
C++
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
string ch[4][2]={{"L","Y"},{"A","G"},{"L","M"},{"A","Gay"}};
int main(){
	srand(time(0));
	cout<<"GENERATE → Card spread generated\n";
	cout<<endl;
	int T;
	cin>>T;
	while(T--){
		string str;
		cin>>str;
		if(str!="GENERATE"){
			cout<<"You are gay!\n";
			continue;
		}
		int t=rand()%24;
		int s=rand()%16;
		int a[4]={1,2,3,4};
		int b[4]={0,0,0,0};
		while(t--){
			next_permutation(a,a+4);
		}
		int now=0;
		while(s){
			b[now]=s%2;
			s/=2;
			now++;
		}
		string st;
		int pts=0;
		for(int i=0;i<4;++i){
			st+=ch[a[i]-1][b[i]];
			cout<<ch[a[i]-1][b[i]]<<' ';
		}
		cout<<endl<<endl;
		for(int i=0;i<st.size()-1;++i){
			if(st[i]=='L'&&st[i+1]=='A'){
				cout<<"Common +1\n";
				cout<<endl;
				cout<<"LA\n";
				cout<<endl;
				pts+=1;
			}
		}
		if(st.find("MY")!=-1){
			cout<<"Common +1\n";
			cout<<endl;
			cout<<"MY\n";
			cout<<endl;
			pts+=1;
		}
		if(st.find("Gay")!=-1){
			cout<<"Common +1\n";
			cout<<endl;
			cout<<"Gay\n";
			cout<<endl;
			pts+=1;
		}
		if(st.find("GYM")!=-1){
			cout<<"Uncommon +2\n";
			cout<<endl;
			cout<<"GYM\n";
			cout<<endl;
			pts+=2;
		}
		if(st.find("LGM")!=-1){
			cout<<"Uncommon +2\n";
			cout<<endl;
			cout<<"LGM\n";
			cout<<endl;
			pts+=2;
		}
		if(st.find("GAY")!=-1){
			cout<<"Rare +3\n";
			cout<<endl;
			cout<<"GAY\n";
			cout<<endl;
			pts+=3;
		}
		if(st.find("YAG")!=-1){
			cout<<"Rare +3\n";
			cout<<endl;
			cout<<"YAG\n";
			cout<<endl;
			pts+=3;
		}
		if(st.find("LALA")!=-1){
			cout<<"Epic +4\n";
			cout<<endl;
			cout<<"LALA\n";
			cout<<endl;
			pts+=4;
		}
		if(st.find("GayGAY")!=-1){
			cout<<"Epic +4\n";
			cout<<endl;
			cout<<"GayGAY\n";
			cout<<endl;
			pts+=4;
		}
		if(st.find("GAYGay")!=-1){
			cout<<"Epic +4\n";
			cout<<endl;
			cout<<"GAYGay\n";
			cout<<endl;
			pts+=4;
		}
		if(st.find("GayYAG")!=-1){
			cout<<"Epic +4\n";
			cout<<endl;
			cout<<"GayYAG\n";
			cout<<endl;
			pts+=4;
		}
		if(st.find("YAGGay")!=-1){
			cout<<"Epic +4\n";
			cout<<endl;
			cout<<"YAGGay\n";
			cout<<endl;
			pts+=4;
		}
		if(st.find("LGMGay")!=-1){
			cout<<"Anomaly +6\n";
			cout<<endl;
			cout<<"LGMGay\n";
			cout<<endl;
			pts+=6;
		}
		if(st.find("GayLGM")!=-1){
			cout<<"Anomaly +6\n";
			cout<<endl;
			cout<<"GayLGM\n";
			cout<<endl;
			pts+=6;
		}
		if(st.find("LAGayM")!=-1){
			cout<<"Mythic +8\n";
			cout<<endl;
			cout<<"LAGayM\n";
			cout<<endl;
			pts+=8;
		}
		cout<<"Final Points : "<<pts<<endl;
		cout<<endl;
		if(pts==0) cout<<"Common\n";
		else if(pts==1) cout<<"Uncommon\n";
		else if(pts==2) cout<<"Rare\n";
		else if(3<=pts&&pts<=4) cout<<"Epic\n";
		else if(5<=pts&&pts<=8) cout<<"Anomaly\n";
		else if(pts==9) cout<<"Mythic\n";
		else if(pts==10) cout<<"TOP1!!!!!\n";
		cout<<endl;
	}
	
}