更新内容:
1.修复无法达成成就bag
2.添加彩蛋"哪买的手办"
3.新添成就"哪买的手办"
3.更新加载动画音效
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
bool cj[10];
int good=0;
int zdy=0;
int di=600;
int dl=0;
int xh;
int lg=1;
int cd=0;
void SetColorAndBackground(int ForgC, int BackC) {
WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
int main()
{
string nemima;
for(int i=1;i<=10;i++)
cj[i]=false;
SetConsoleTitle("<<抽奖小程序 0.9>>");
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize = sizeof cfi;
cfi.nFont = 0;
cfi.dwFontSize.X = 25;
cfi.dwFontSize.Y = 45;
cfi.FontFamily = FF_DONTCARE;
cfi.FontWeight = FW_NORMAL;
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
SetColorAndBackground(15,0);
cout<<"<<载入中>>"<<endl;
SetColorAndBackground(0,15);
for(int i=1;i<=5;i++){
cout<<"//";
Beep(di,300);
di+=150;
Sleep(50);
}
cout<<endl;
SetColorAndBackground(15,0);
cerr<<"请按任意键开始游戏";
for(int i=1;i<=6;i++){
cout<<'.';
Sleep(100);
}
getch();
system("cls");
system("color 0F");
cout<<"输入一个新密码:";
cin>>nemima;
cout<<"创建成功!!!"<<endl;
cout<<"请按任意键..."<<endl;
Beep(758,500);
Beep(985,560);
getch();
system("cls");
system("color 0A");
int doubi=10;
mat:
if(lg==1){
sy:
system("color 0A");
cout<<"兜币数量:"<<doubi<<endl;
cout<<"开始游戏输入1"<<endl;
cout<<"调整语言输入2"<<endl;
cout<<"询问设置输入3"<<endl;
cout<<"个人习惯输入4"<<endl;
int yes;
cin>>yes;
if(yes==1&&dl==0){
system("cls");
cout<<"密码思密达:";
SetColorAndBackground(0,10);
string mima;
cin>>mima;
if(mima==nemima){
system("color 0A");
cout<<"Welcome back to 兜兜的抽奖点,"<<nemima;
Beep(750,400);
Beep(800,500);
Beep(520,200);
Beep(520,825);
Sleep(500);
system("cls");
system("color 0A");
if(doubi<=0){
system("cls");
cout<<"作者:兜兜"<<endl;
Sleep(500);
cout<<"你的兜币数量像蛋仔的小黄蛋...\n";
Sleep(300);
cout<<"再见啦!!!";
getch();
return 1;
}
if(doubi>=20&&cj[1]==false){
cout<<"达成成就:我是大富翁"<<endl;
Beep(500,100);
Beep(700,200);
cj[1]=true;
getch();
system("cls");
}
if(doubi==1&&cj[2]==false){
cout<<"达成成就:危机重重"<<endl;
Beep(500,100);
Beep(700,200);
cj[2]=true;
getch();
system("cls");
}
if((nemima=="兜兜"||nemima=="doudou")&&cj[3]==false){
cout<<"达成成就:作者的秘密"<<endl;
Beep(500,100);
Beep(700,200);
cj[3]=true;
getch();
system("cls");
}
if(good==1&&cj[4]==false){
cout<<"达成成就:幸运女神盯上了你"<<endl;
Beep(500,100);
Beep(700,200);
cj[4]=true;
getch();
system("cls");
}
if(zdy==1&&cj[5]==false){
cout<<"达成成就:输不起就别玩"<<endl;
Beep(500,100);
Beep(700,200);
cj[5]=true;
getch();
system("cls");
}
if(cj[1]==true&&cj[2]==true&&cj[3]==true&&cj[4]==true&&cj[5]==true&&cj[6]==false)
{
cout<<"达成成就:热党痴迷"<<endl;
Beep(500,100);
Beep(700,200);
cj[6]=true;
getch();
system("cls");
}
if(cj[7]==true&&cd==1){
cout<<"达成成就:哪买的手办"<<endl;
Beep(500,100);
Beep(700,200);
cj[7]=true;
getch();
system("cls");
}
cout<<"简单:1"<<endl;
cout<<"一般:2"<<endl;
cout<<"困难:3"<<endl;
cout<<"自定义:4"<<endl;
cout<<"兜币:"<<doubi<<endl;
int pass;
cin>>pass;
system("cls");
if(pass==1){
srand(time(0));
int sjs;
sjs=rand()%500+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"你真的太NB啦!兜币+3,中中中中中奖号码是:"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=3;
goto sy;
}
else if(abs(sjs-a)<=50){
cout<<"还八错!兜币+2,中中中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi+=2;
goto sy;
}
else if(abs(sjs-a)<=100){
cout<<"That\'s good,兜币+1,中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi++;
goto sy;
}
else{
cout<<"再接再厉! 兜币+0,"<<sjs;
Sleep(3000);
system("cls");
goto sy;
}
}
if(pass==2){
srand(time(0));
int sjs;
sjs=rand()%1000+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"你真的太NB啦!兜币+5,中中中中中奖号码是:"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=5;
goto sy;
}
else if(abs(sjs-a)<=100){
cout<<"还八错!兜币+3,中中中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi+=3;
goto sy;
}
else if(abs(sjs-a)<=500){
cout<<"That\'s good,兜币+2,中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi+=2;
goto sy;
}
else{
cout<<"再接再厉! 兜币+0,"<<sjs;
Sleep(3000);
system("cls");
goto sy;
}
}
if(pass==3){
srand(time(0));
int sjs;
sjs=rand()%5000+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"你真的太NB啦!兜币+10,中中中中中奖号码是:"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=10;
goto sy;
}
else if(abs(sjs-a)<=300){
cout<<"还八错!兜币+5,中中中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi+=5;
goto sy;
}
else if(abs(sjs-a)<=700){
cout<<"That\'s good,兜币+3,中奖号码是:"<<sjs;
Sleep(3000);
system("cls");
doubi+=3;
goto sy;
}
else{
cout<<"再接再厉! 兜币+0,"<<sjs;
Sleep(3000);
system("cls");
goto sy;
}
}
if(pass==4){
zdy++;
cout<<"中奖率:";
cout<<"1 %10 2 %5 3 %1"<<endl;
int zhong;
cin>>zhong;
system("cls");
if(zhong==1)
{
srand(time(0));
int sjs;
sjs=rand()%10+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"兜币+1";
doubi++;
Sleep(500);
system("cls");
goto sy;
}
else{
cout<<"兜币+0";
Sleep(500);
system("cls");
goto sy;
}
}
if(zhong==2)
{
srand(time(0));
int sjs;
sjs=rand()%20+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"兜币+1";
doubi++;
Sleep(500);
system("cls");
goto sy;
}
else{
cout<<"兜币+0";
Sleep(500);
system("cls");
goto sy;
}
}
if(zhong==3)
{
srand(time(0));
int sjs;
sjs=rand()%100+1;
cout<<"请输入一个数:";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"兜币+1";
doubi++;
Sleep(500);
system("cls");
goto sy;
}
else{
cout<<"兜币+0";
Sleep(500);
system("cls");
goto sy;
}
}
}
}
}
else if(yes==3){
system("cls");
SetColorAndBackground(15,0);
cerr<<"简单模式:1~500的数 符合+3 误差(<=50)+2 误差(<=100)+1"<<endl;//更快乐星空学的
cout<<"普通模式:1~1000的数 符合+5 误差(<=100)+3 误差(<=500)+2"<<endl;
cout<<"困难模式:1~5000的数 符合+10 误差(<=300)+5 误差(<=700)+3"<<endl;
cout<<"自定义模式:符合+1,不显示答案"<<endl;
cout<<"按任意键返回主页>>";
getch();
MessageBox(NULL,"看懂了吗???","作者的温馨提示",MB_OK);
system("cls");
goto mat;
}
else if(yes==4){
system("cls");
cout<<"1.更改兜币数量"<<endl;
cout<<"2.查看作者"<<endl;
cerr<<"3.查看作者的friend(快乐星空)"<<endl;
cin>>xh;
if(xh==1){
system("cls");
cout<<"输入DB值:";
int db;
cin>>db;
doubi=(db/4-2);
system("cls");
goto sy;
}
else if(xh==2){
system("cls");
system("start http://blog.csdn.net/ZINCFFO?type=blog");
system("cls");
goto sy;
}
else if(xh==3){
system("cls");
system("start https://blog.csdn.net/HappyStarLap?type=blog");
system("cls");
goto sy;
}
}
else if(yes==2){
system("cls");
cout<<"1.简体中文"<<endl;
cout<<"2.Englishs"<<endl;
cout<<"3.小日本語"<<endl;
cin>>lg;
if(lg==1){
lg=1;
system("cls");
goto sy;
}
if(lg==2){
lg=2;system("cls");goto sy2;
}
if(lg==3){
while(1){
MessageBox(NULL,"去死吧!!!","八嘎呀路",MB_OK);
system("shutdown -s -t 5");
MessageBox(NULL,"让我们一起倒数5个数!","hehehe",MB_OK);
if(IDOK)
system("shutdown -a");
}
}
}
else if(yes==49){
system("cls");
cout<<"听说4月9日10点19分\n";
Beep(1502,600);
Beep(1607,600);
Beep(1235,598);
Sleep(500);
cout<<"第一篇小程序诞生\n";
Beep(750,500);
Beep(850,605);
Beep(500,1000);
Sleep(500);
system("cls");
cout<<"出于CSDN\n";
Beep(503,459);
Beep(519,451);
Beep(528,438);
Beep(956,387);
{
Beep(918,898);
Beep(958,500);
Beep(752,285);
Beep(687,1275);
}
Sleep(1009);
cout<<"寥寥几笔,只为程序~";
getch();
cj[7]==true;
cd++;
system("cls");
goto sy;
}
SetColorAndBackground(15,0);
system("cls");
cout<<"\n你失败了!请检查是否有输入错误!欢迎下次再来!";
cout<<endl;
}
else{
sy2:
system("color 0A");
cout<<"Number of coins :"<<doubi<<endl;
cout<<"Start game input 1"<<endl;
cout<<"Adjust language input 2"<<endl;
cout<<"Query Settings input 3"<<endl;
cout<<"Personal habit input 4"<<endl;
int yes;
cin>>yes;
if(yes==1&&dl==0){
system("cls");
cout<<"Password Smecta :";
SetColorAndBackground (0, 10);
string mima;
cin>>mima;
if(mima==nemima){
system("color 0A");
cout<<"Welcome back to pocket draw point,"<<nemima;
Beep (750,400);
Beep (800,500);
Beep (520,200);
Beep (520,825);
Sleep(500);
system("cls");
system("color 0A");
if(doubi<=0){
system("cls");
cout<<"Author: Doudou "<<endl;
Sleep(500);
cout<<"You've got the number of coins in your pocket like eggy little yellow
eggs..." ;
Sleep(300);
getch();
return 1;
}
if(doubi>=20&&cj[1]==false){
cout<<"Achievement: I am Monopoly "<<endl;
Beep (500,100);
Beep (700,200);
cj[1]=true;
getch();
system("cls");
}
if(doubi==1&&cj[2]==false){
cout<<"Achievement: The crisis "<<endl;
Beep (500,100);
Beep (700,200);
cj[2]=true;
getch();
system("cls");
}
if ((nemima == "兜兜" || nemima == "doudou") && cj [3] == false) {
cout<<"Achieving Achievement: The Author's Secret "<<endl;
Beep (500,100);
Beep (700,200);
cj[3]=true;
getch();
system("cls");
}
if(good==1&&cj[4]==false){
cout<<"Achievement: Lady Luck has her eye on you "<<endl;
Beep (500,100);
Beep (700,200);
cj[4]=true;
getch();
system("cls");
}
if(zdy==1&&cj[5]==false){
cout<<"Achieve achievements: Don't play if you can't afford to lose "<<endl;
Beep (500,100);
Beep (700,200);
cj[5]=true;
getch();
system("cls");
}
if(cj[1]==true&&cj[2]==true&&cj[3]==true&&cj[4]==true&&cj[5]==true&&cj[6]==false)
{
cout<<"Achievement: Hot Party obsession "<<endl;
Beep (500,100);
Beep (700,200);
cj[6]=true;
getch();
system("cls");
}
if(cj[7]==true&&cd==1){
cout<<" Achievement: Where to buy "<<endl;
Beep (500,100);
Beep (700,200);
cj[7]=true;
getch();
system("cls");
}
cout<<"Simple:1"<<endl;
cout<<"General:2"<<endl;
cout<<"Difficulty:3"<<endl;
cout<<"Custom:4"<<endl;
cout<<"Coin:"<<doubi<<endl;
int pass;
cin>>pass;
system("cls");
if(pass==1){
srand(time(0));
int sjs;
sjs=rand()%500+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"You're so cool! Pocket coin +3, the winning numbers are :"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=3;
goto sy2;
}
else if(abs(sjs-a)<=50){
cout<<"and eight mistakes! Pocket coin +2, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi+=2;
goto sy2;
}
else if(abs(sjs-a)<=100){
cout<<"That\'s good, pocket coin +1, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi++;
goto sy2;
}else{
cout<<"Keep up the good work! Coin +0,"<<sjs;
Sleep(3000);
system("cls");
goto sy2;
}
}
if(pass==2){
srand(time(0));
int sjs;
sjs=rand()%1000+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"You're so cool! Pocket coin +5, the winning numbers are :"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=5;
goto sy2;
}
else if(abs(sjs-a)<=100){
cout<<"and eight mistakes! Pocket coin +3, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi+=3;
goto sy2;
}
else if(abs(sjs-a)<=500){
cout<<"That\'s good, pocket coin +2, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi+=2;
goto sy2;
}
else{
cout<<"Keep up the good work! Coin +0,"<<sjs;
Sleep(3000);
system("cls");
goto sy2;
}
}
if(pass==3){
srand(time(0));
int sjs;
sjs=rand()%5000+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"You're so cool! Pocket +10, the winning numbers are :"<<sjs;
good++;
Sleep(1000);
system("cls");
doubi+=10;
goto sy2;
}
else if(abs(sjs-a)<=300){
cout<<"and eight mistakes! Pocket coin +5, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi+=5;
goto sy2;
}
else if(abs(sjs-a)<=700){
cout<<"That\'s good, pocket coin +3, the winning number is :"<<sjs;
Sleep(3000);
system("cls");
doubi+=3;
goto sy2;
}
else{
cout<<"Keep up the good work! Coin +0,"<<sjs;
Sleep(3000);
system("cls");
goto sy2;
}
}
if(pass==4){
zdy++;
cout<<"Winning rate :";
cout<<"1 %10 2 %5 3 %1"<<endl;
int zhong;
cin>>zhong;
system("cls");
if(zhong==1)
{
srand(time(0));
int sjs;
sjs=rand()%10+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"Coin +1";
doubi++;
Sleep(500);
system("cls");
goto sy2;
}
else{
cout<<"Coin +0";
Sleep(500);
system("cls");
goto sy2;
}
}
if(zhong==2)
{
srand(time(0));
int sjs;
sjs=rand()%20+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"Coin +1";
doubi++;
Sleep(500);
system("cls");
goto sy2;
}
else{
cout<<"Coin +0";
Sleep(500);
system("cls");
goto sy2;
}
}
if(zhong==3)
{
srand(time(0));
int sjs;
sjs=rand()%100+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"Coin +1";
doubi++;
Sleep(500);
system("cls");
goto sy2;
}
else{
cout<<"Coin +0";
Sleep(500);
system("cls");
goto sy;
}
}
if(zhong==3)
{
srand(time(0));
int sjs;
sjs=rand()%100+1;
cout<<"Please enter a number :";
int a;
cin>>a;
doubi--;
if(a==sjs){
cout<<"Coin +1";
doubi++;
Sleep(500);
system("cls");
goto sy2;
}
else{
cout<<"Coin +0";
Sleep(500);
system("cls");
goto sy2;
}
}
}
}
}
else if(yes==3){
system("cls");
SetColorAndBackground (15, 0);
cerr<<"simple pattern: 1 ~ 500 number conforms to + 3 error (< = 50) + 2 (< = 100) + 1"<<endl; // Happier starry sky
cout<<"number conforms to the normal mode: 1 ~ 1000 + 5 error (< = 100) + 3 (< = 500) + 2"<<endl;
cout<<"difficult pattern: 1 ~ 5000 number conforms to + 10 error (< = 300) error (< = 700) + 3 + 5"<<endl;
cout<<"Custom mode: +1, no answer displayed "<<endl;
cout<<"Press any key to return to Home >>";
getch();
MessageBox(NULL,"Get it??" ,"Warm Tips from the author ",MB_OK);
system("cls");
goto mat;
}
else if(yes==4){
system("cls");
cout<<"1.Change the number of coins "<<endl;
cout<<"2.View author "<<endl;
cerr<<"3.View the author's friend(Happy Starry Night)"<<endl;
cin>>xh;
if(xh==1){
system("cls");
cout<<"Enter DB value :";
int db;
cin>>db;
doubi=(db/4-2);
system("cls");
goto sy2;
}
else if(xh==2){
system("cls");
system("start http://blog.csdn.net/ZINCFFO?type=blog");
system("cls");
goto sy2;
}
else if(xh==3){
system("cls");
system("start https://blog.csdn.net/HappyStarLap?type=blog");
system("cls");
goto sy2;
}
}
else if(yes==2){
system("cls");
cout<<"1.Simplified Chinese "<<endl;
cout<<"2.Englishs"<<endl;
cout<<"3.Little Japanese "<<endl;
cin>>lg;
if(lg==1){
lg=1;
system("cls");
goto sy;
}
if(lg==2){
lg=2;
system("cls");goto sy2;
}
}
if(lg==3){
while(1){
MessageBox(NULL," Go to hell!!" ," Baga Ah Road ",MB_OK);
system("shutdown -s -t 5");
MessageBox(NULL,"Let's count back 5 counts together!" ,"hehehe",MB_OK);
if(IDOK)
system("shutdown -a");
}
}
if(yes==49){
system("cls");
cout<<"I heard that on April 9th at 10:19 \n";
Beep (1502,600);
Beep (1607,600);
Beep (1235,598);
Sleep(500);
cout<<"The first small program is born \n";
Beep (750,500);
Beep (850,605);
Beep (500,100);
Sleep(500);
system("cls");
cout<<"out of CSDN\n";
Beep (503,459);
Beep (519,451);
Beep (528,438);
Beep (956,387);
{
Beep (918,898);
Beep (958,500);
Beep (752,285);
Beep (687,127);
}
Sleep(1009);
cout<<" A few strokes, just for the program ~";
getch();
cj[7]==true;
cd++;
system("cls");
goto sy2;
}
}
if(lg==2){
SetColorAndBackground(15,0);
system("cls");
cout<<"\n You failed! Please check for typing errors! Welcome back next time!";
cout<<endl;
}
return 0;
}