在以前的基础上,我把绝地NBA新增了三分大赛~~
code
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string player,moshi;
int sanfen,zhongtou,neixian,neifang,waifang;
int tops,s,s1=0,s2=0;string n,m;//王朝模式
int score=0;string huaqiudian,hqd[5]={
"left-corner","left-wing","top-key","right-wing","right-corner"};
int Beginning()
{
cout<<" 绝 ";
Sleep(300);
cout<<"地 ";
Sleep(300);
cout<<"N ";
Sleep(300);
cout<<"B ";
Sleep(300);
cout<<"A ";
Sleep(1000);
cout<<"\n\n";
cout<<" ";
cout<<"(";
Sleep(100);
cout<<"点";
Sleep(100);
cout<<"击";
Sleep(100);
cout<<"回";
Sleep(100);
cout<<"车";
Sleep(100);
cout<<"以";
Sleep(100);
cout<<"进";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<")";
Sleep(500);
cout<<"\n ";
cout<<"P";
Sleep(100);
cout<<"r";
Sleep(100);
cout<<"o";
Sleep(100);
cout<<"u";
Sleep(100);
cout<<"d";
Sleep(100);
cout<<"l";
Sleep(100);
cout<<"y";
Sleep(100);
cout<<' ';
Sleep(100);
cout<<"p";
Sleep(100);
cout<<"r";
Sleep(100);
cout<<"o";
Sleep(100);
cout<<"d";
Sleep(100);
cout<<"u";
Sleep(100);
cout<<"c";
Sleep(100);
cout<<"e";
Sleep(100);
cout<<"d";
Sleep(100);
cout<<' ';
Sleep(100);
cout<<"b";
Sleep(100);
cout<<"y";
Sleep(100);
cout<<' ';
Sleep(100);
cout<<"Z";
Sleep(100);
cout<<"i";
Sleep(100);
cout<<"y";
Sleep(100);
cout<<"a";
Sleep(100);
cout<<"n";
Sleep(100);
cout<<' ';
Sleep(100);
cout<<"F";
Sleep(100);
cout<<"a";
Sleep(100);
cout<<"n";
Sleep(100);
cout<<"g";
Sleep(100);
}
int choose()
{
aa:
getchar();
system("cls");
cout<<"请从下面几位球星中选择你最喜欢的一位:\nCurry James Antetokounmpo Durant Harden Kobe Bogut\n:";
cin>>player;
if(player!="Curry" && player!="James" && player!="Antetokounmpo" && player\
!="Durant" && player!="Harden" && player!="Kobe" && player!="Bogut"){
system("cls");
cout<<"搞错了,再来!";
Sleep(2000);
goto aa;
}
}
int mosh()
{
system("cls");
cout<<"请选择模式:\n\n1、王朝模式\n2、三分大赛\n3、扣篮大赛\n\n(输入序号):";
cin>>moshi;
}
int wangchao()
{
Sleep(2000);
system("cls");
cout<<"温馨提示:进攻状态下,按1投三分,按2投两分,按3内线,按4传球!\n";
Sleep(3000);
cout<<"防守状态下,按1抢断,按2盖帽,按3抢篮板!\n";
Sleep(2000);
cout<<"现在您可以设定比赛获胜分数:";
cin>>tops;
do{
system("cls");
int qiuquan=rand()%1+1;
cout<<"双方跳球!";
Sleep(2000);
if(qiuquan<=1)
goto jingong;
else
goto fangshou;
jingong:
system("cls");
cout<<"您获得了进攻权!\n";
Sleep(2000);
cout<<"请做出进攻选择:";
cin>>n;
if(n=="1"){
int a=rand()%39+1; //产生1~40随机数
if(sanfen-a>65){
s1+=3;
cout<<player<<"三分命中!\n现在双方比分为"<<s1<<':'<<s2<<"。";
Sleep(4000);
system("cls");
if(s1>tops)break;
else
goto fangshou;
}
else{
cout<<"没有命中!\n现在双方比分为"<<s1<<':'<<s2<<"。";
Sleep(4000);
system("cls");
if(s1>tops)break;
else
goto fangshou;
}
}
if(n=="2"){
int a=rand()%39+1;
if(zhongtou-a>65){
s1+=2;
cout<<player<<"两分打进!\n现在双方比分为"<<s1<<':'<<s2<<"。";
Sleep(4000);
system("cls");
if(s1>tops)break;
else
goto fangshou;
}
else{
cout<<"没有命中!\n现在双方比分为"<<s1<<':'<<s2<<"。";
Sleep(4000);
system("cls");
if(s1>tops)break;
else
goto fangshou;
}
}
if(n=="3"){
int a=rand()%39+1;
int b=rand()%2+1;
if(neixian-a>