玩法:随机抽取地点人物事件,来组句
2024/10/03 进行微调.
\(代码/Code:\)
#include<bits/stdc++.h>
#include<windows.h>
#define SM_ printf("%c%c%c%c%c%c",-64,-18,-278,-59,-319,-40);
using namespace std;
int s1,s2,s3,xz1,bool01;
string copy_;
string place[105]= {"在学校里","在餐厅里","在厕所里","在家里","在上课时","在成年公寓里","在小树林里","在臭水沟里","在上厕所时","在床上","在女生宿舍里","在女厕里","在讲台上","在粪坑里","在打游戏时","在晚上时","在打架时"};
string with[105]= {"和老师一起","和孙海洋一起","和妈妈一起","抱着空调","和一个男生一起","和对象一起","抱着姐姐","和华子睿一起","与李佳俊一起","叼着鞋子","和东施","与一个女生一起","和肖明洋一起","和小蜜蜂一起","和孟祥帅一起","和吴俊宇一起","骑着孙海洋"};
string done[105]= {"吃屎","同床共枕","啃脚丫","流口水","亲吻","像狗一样死去","阴暗的爬行","跳钢管舞","遨游太空","扣鼻屎","畅谈人生","一起吃大餐","洗澡","兰花指并说哥哥来啦?","滚来滚去","肘击劳大","用脚洗脸","亲密"};
void Slowsay(string s) {
for (int i = 0; s[i]; i++) {
cout << s[i];
int ttt;
for (int i = 1; i <= 1000000; i++)ttt++;
}
}
void Copy(string TempBin) { //复制至剪切板
HGLOBAL hMemBin = NULL;
PCHAR LockBin = NULL;
OpenClipboard(NULL);
EmptyClipboard();
hMemBin = GlobalAlloc(GMEM_MOVEABLE, TempBin.size() + 1);
LockBin = (PCHAR)GlobalLock(hMemBin);
RtlMoveMemory(LockBin, TempBin.c_str(), TempBin.size() + 1);
GlobalUnlock(hMemBin);
LockBin = NULL;
SetClipboardData(CF_TEXT, hMemBin);
CloseClipboard();
}
void Color(int a) { //改变单字颜色 (白蓝绿紫红靛黄)
if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
}
void swap_pwd()
{
srand((unsigned)time(NULL));
swap(place[0],place[1]);swap(place[2],place[3]);swap(place[4],place[5]);swap(place[6],place[7]);swap(place[8],place[9]);swap(place[10],place[11]);swap(place[12],place[13]);swap(place[14],place[15]);
swap(with[0],with[1]);swap(with[2],with[3]);swap(with[4],with[5]);swap(with[6],with[7]);swap(with[8],with[9]);swap(with[10],with[11]);swap(with[12],with[13]);swap(with[14],with[15]);
swap(done[0],done[1]);swap(done[2],done[3]);swap(done[4],done[5]);swap(done[6],done[7]);swap(done[8],done[9]);swap(done[10],done[11]);swap(done[12],done[13]);swap(done[14],done[15]);
}
int main() {
while(true) {
Color(0),Slowsay("请问你自己选择还是由电脑选择? (输入1为自己选||0为电脑选) ");
Color(6),cout<<' '<<' '<<' ';SM_;
cout<<"制作. \n\n";
cin>>xz1;
cout<<"\n";
switch(xz1) {
case 1: {
hxq: Color(3),Slowsay("请输入3个小于等于16且大于等于0的数,每两个数之间要有一个空格.\n\n");
Color(1),cin>>s1>>s2>>s3;
bool01=rand()%2;
if(bool01) swap_pwd();
if(s1<0||s2<0||s3<0||s1>17||s2>17||s3>17)
{
Color(6),cout<<"输入似乎有点错误,请重新输入~\n\n";
goto hxq;
}
Color(2),Slowsay("抽选中...\n\n");
Sleep(1200);
Color(6),cout<<place[s1]<<with[s2]<<done[s3]<<'\n';
copy_=place[s1]+with[s2]+done[s3];
Copy(copy_);
Color(4),Slowsay("\n内容已复制.\n\n");
Color(1),system("pause\n\n");
break;
}
case 0: {
srand((unsigned)time(NULL));
s1=rand()%17-1;
s2=rand()%17-1;
s3=rand()%17;
bool01=rand()%2;
if(bool01) swap_pwd();
Color(2),Slowsay("抽选中...\n\n");
Sleep(1200);
Color(6),cout<<place[s1]<<with[s2]<<done[s3]<<'\n';
copy_=place[s1]+with[s2]+done[s3];
Copy(copy_);
Color(4),Slowsay("\n内容已复制.\n\n");
Color(1),system("pause\n\n");
break;
}
default:{
Color(3),Slowsay("输入错误,请重新输入~\n\n");
break;
}
}
}
return 0;
}
标签:string,机组,V1.13,c%,小游戏,一起,bool01,105,cout
From: https://www.cnblogs.com/yuhxq/p/18448225