📄 card.cpp.txt
字号:
#include "card.h"
int main()
{
Linkcard *InitLink=new Linkcard;InitLink->next=NULL;
card Gamble(InitLink);
int number;
int ran;
int o=1;
int u=1;
int e=1;
string J="John",T="Tony",P="Palmer";
Linkcard *Linkfirst,*Linksecond,*Linkthird;
loop: cout<<"扑克牌游戏:金花"<<endl;
cout<<" .............................................."<<endl;
cout<<" 1.参与赌局的玩家 "<<endl;
cout<<" 2.一副崭新的完整的扑克牌 "<<endl;
cout<<" 3.洗牌 "<<endl;
cout<<" 4.发牌,赌局开始 "<<endl;
cout<<" 5.获胜玩家 "<<endl;
cout<<" 6.exit" ""<<endl;
cout<<" .............................................."<<endl;
cout<<"Make a choice:";
cin>>number;
while(number<1 || number>6)
{
cout<<"Error.操作错误!"<<endl;
cout<<"Make a new Choice:";
cin>>number;
}
switch(number)
{
case 1:
Gamble.Namecard(J,T,P);
cout<<"参与赌局的玩家:";
cout<<Gamble.Playerp()<<" ";
cout<<Gamble.PlayerR()<<" ";
cout<<Gamble.PlayerT()<<" ";
cout<<endl;
cout<<endl;
cout<<endl;
goto loop;
case 2:
//Gamble.card(InitLink);
cout<<"一副完整的扑克牌:"<<endl;
Linkfirst=Gamble.Showcard(); //Linkfirst;
Linksecond=Gamble.Outprintcard(Linkfirst); //Linksecond;
cout<<endl;
cout<<endl;
cout<<endl;
goto loop;
case 3:
Linkthird=Gamble.Shufflecard(Linksecond);
Gamble.OutPrintcard(Linkthird);
cout<<endl;
cout<<endl;
cout<<endl;
goto loop;
case 4:
ran=rand()%52;
while(ran==1)
ran=rand()%52;
cout<<"得到三个人的牌:"<<endl;
Gamble.Licesecard(Linkthird,ran);
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
goto loop;
case 5:
Linkcard* Win;
Win=Gamble.Wincard(Gamble.headrJ,Gamble.headrT);
Gamble.Woncard(Win,Gamble.headrP);
cout<<endl;
cout<<endl;
cout<<endl;
goto loop;
case 6:
exit(0);
cout<<endl;
goto loop;
}
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -