Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #include"poker_element.h"
- using namespace std;
- int main()
- {
- //Basic setting
- initial();
- shuffle(10000);
- shuffle(10000);
- shuffle(10000);
- shuffle(10000);
- // Player2 Start
- // endllise the Player1's amounts
- int Player1_card_keep;
- int Player1_card_score;
- int Player1_card_A;
- char Player1_card_wantYN;
- int Player1_servied;
- // set the int and char's value
- Player1_card_keep=0;
- Player1_card_score=0;
- Player1_card_A=0;
- Player1_card_wantYN='y';
- Player1_servied=0;
- char Explain;
- cout<<"Show out the Explain of this programe?(y/n)";
- cin>>Explain;
- if(Explain=='y'){
- cout<<"The Poker Ver0.9.2."<<endl;
- cout<<"The program would auto cancel your move while your point is >=21 even if you say keep draw."<<endl;
- cout<<"Show the Message about HackMode?(y/n)";
- cin>>Explain;
- if(Explain=='y'){
- cout<<"HackMode is a Mode for this programe that could help you cheat or Edit by hand without luck."<<endl;
- cout<<"It would ask you to Enable it or not later. But it is not such easy to enable actually."<<endl;
- cout<<"Hope you had a good luck"<<endl;
- }
- }
- char HackMode;
- int HackMode_use;
- HackMode=0;
- HackMode_use=0;
- cout<<"Enable the Hack mode?(y/n)";
- cin>>HackMode;
- if(HackMode=='a'){
- cout<<"Warring! This is not yet done! Are you sure to enable it?(y/n)";
- cin>>HackMode;
- if(HackMode=='b'){
- HackMode_use=1;
- cout<<"The Player2's HackMode had bugs that would crash the whole programe.It can't be use anyway now."<<endl;
- }
- }
- cout<<"Show out the cards?(y/n)";
- cin>>HackMode;
- if(HackMode=='y'){
- display_allcard();
- }
- cout<<"Let's start!"<<endl;
- cout<<"Start draw!!"<<endl;
- // first draw
- while(Player1_card_wantYN== 'y')
- {
- Player1_card_keep=draw(1);
- Player1_card_keep=Player1_card_keep%13;
- Player1_card_keep=Player1_card_keep+1;
- cout<<"Player1 get ";
- cout<<Player1_card_keep;
- if(Player1_card_keep>10)
- {
- Player1_card_keep=10;
- }
- if(Player1_card_keep==1)
- {
- Player1_card_A=Player1_card_A+1;
- Player1_card_keep=11;
- }
- Player1_card_score=Player1_card_score+Player1_card_keep;
- cout<<""<<endl;
- if(Player1_card_score>21)
- {
- if(Player1_card_A>=1)
- {
- Player1_card_score=Player1_card_score-10;
- Player1_card_A=Player1_card_A-1;
- }
- }
- cout<<"Player1's point is now ";
- cout<<Player1_card_score;
- cout<<""<<endl;
- cout<<"Continute to get card?(Y/n)";
- cin>>Player1_card_wantYN;
- cout<<""<<endl;
- //The check for player score >=21
- if(Player1_card_score==21)
- {
- cout<<"Your point is already the max 21, You shall not keep draw";
- Player1_card_wantYN='N';
- }
- if(Player1_card_score>21){
- cout<<"You already higher than 21, Please not keep draw.";
- Player1_card_wantYN='N';
- }
- }
- //Hack mode message
- if(HackMode_use==1){
- cout<< ""<<endl;
- cout<<"Hack Messager"<<endl;
- cout<<"-----------------------"<<endl;
- cout<<"Let you keep get card?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode== 'y'){
- Player1_card_wantYN=1;
- }
- else{
- cout<<"Keep the value"<<endl;
- }
- cout<<"Edit the final Point direct?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode=='y'){
- cout<<"Please key in the value you want to let it be.";
- cin>>HackMode;
- Player1_card_score=HackMode;
- }
- cout<<"-----------------------"<<endl;
- }
- /* cout<<Player1_card_wantYN;
- cout<<""<<endl; */
- //show out message
- // do not have to do after the Check score>=21 done write
- /* cout<<"The check of the pick"<<endl;
- cout<<"Amount of Player The Basic card ";
- cout<<Player1_card_score<<endl;
- cout<<"Amount of Player1's A ";
- cout<<Player1_card_A<<endl; */
- //end check
- cout<<"Here is player1's card!!"<<endl;
- display_player_card(1);
- cout<<"This is Player1's card Sum!!"<<endl;
- cout<<Player1_card_score<<endl;
- if(Player1_card_score<=21)
- {
- cout<<"Player1 had not died!"<<endl;
- }
- else
- {
- cout<<"Player1 lose!"<<endl;
- Player1_servied=1;
- }
- system("pause");
- // Player1 End
- // Player2 Start
- // endllise the Player2's amounts
- int Player2_card_keep;
- int Player2_card_score;
- int Player2_card_A;
- char Player2_card_wantYN;
- int Player2_servied;
- // set the int and char's value
- Player2_card_keep=0;
- Player2_card_score=0;
- Player2_card_A=0;
- Player2_card_wantYN='y';
- Player2_servied=0;
- while(Player2_card_wantYN== 'y'){
- Player2_card_keep=draw(1);
- Player2_card_keep=Player2_card_keep%13;
- Player2_card_keep=Player2_card_keep+1;
- cout<<"Player2 get ";
- cout<<Player2_card_keep;
- if(Player2_card_keep>10){
- Player2_card_keep=10;
- }
- if(Player2_card_keep==1){
- Player2_card_A=Player2_card_A+1;
- Player2_card_keep=11;
- }
- Player2_card_score=Player2_card_score+Player2_card_keep;
- cout<<""<<endl;
- if(Player2_card_score>21){
- if(Player2_card_A>=1){
- Player2_card_score=Player2_card_score-10;
- Player2_card_A=Player2_card_A-1;
- }
- }
- cout<<"Player2's point is now ";
- cout<<Player2_card_score;
- cout<<""<<endl;
- cout<<"Continute to get card?(Y/n)";
- cin>>Player2_card_wantYN;
- cout<<""<<endl;
- //The check for player score >=21
- if(Player2_card_score==21){
- cout<<"Your point is already the max 21, You shall not keep draw";
- Player2_card_wantYN='N';
- }
- if(Player2_card_score>21){
- cout<<"You already higher than 21, Please not keep draw.";
- Player2_card_wantYN='N';
- }
- }
- /*
- //Hack mode message
- if(HackMode_use==1){
- cout<< ""<<endl;
- cout<<"Hack Messager"<<endl;
- cout<<"-----------------------"<<endl;
- cout<<"Let you keep get card?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode== 'y'){
- Player2_card_wantYN=1;
- }
- else{
- cout<<"Keep the value"<<endl;
- }
- cout<<"Edit the final Point direct?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode=='y'){
- cout<<"Please key in the value you want to let it be.";
- cin>>HackMode;
- Player2_card_score=HackMode;
- }
- cout<<"-----------------------"<<endl;*/
- /* cout<<Player2_card_wantYN;
- cout<<""<<endl; */
- //show out message
- // do not have to do after the Check score>=21 done write
- /* cout<<"The check of the pick"<<endl;
- cout<<"Amount of Player The Basic card ";
- cout<<Player2_card_score<<endl;
- cout<<"Amount of Player2's A ";
- cout<<Player2_card_A<<endl; */
- //end check
- cout<<"Here is Player2's card!!"<<endl;
- display_player_card(2);
- cout<<"This is Player2's card Sum!!"<<endl;
- cout<<Player2_card_score<<endl;
- if(Player2_card_score<=21)
- {
- cout<<"Player2 had not died!"<<endl;
- }
- else
- {
- cout<<"Player2 lose!"<<endl;
- Player2_servied=1;
- }
- system("pause");
- // Player2's game end.
- // Player3 Start
- // endllise the Player3's amounts
- int Player3_card_keep;
- int Player3_card_score;
- int Player3_card_A;
- char Player3_card_wantYN;
- int Player3_servied;
- // set the int and char's value
- Player3_card_keep=0;
- Player3_card_score=0;
- Player3_card_A=0;
- Player3_card_wantYN='y';
- Player3_servied=0;
- while(Player3_card_wantYN== 'y'){
- Player3_card_keep=draw(1);
- Player3_card_keep=Player3_card_keep%13;
- Player3_card_keep=Player3_card_keep+1;
- cout<<"Player3 get ";
- cout<<Player3_card_keep;
- if(Player3_card_keep>10)
- {
- Player3_card_keep=10;
- }
- if(Player3_card_keep==1)
- {
- Player3_card_A=Player3_card_A+1;
- Player3_card_keep=11;
- }
- Player3_card_score=Player3_card_score+Player3_card_keep;
- cout<<""<<endl;
- if(Player3_card_score>21)
- {
- if(Player3_card_A>=1)
- {
- Player3_card_score=Player3_card_score-10;
- Player3_card_A=Player3_card_A-1;
- }
- }
- cout<<"Player3's point is now ";
- cout<<Player3_card_score;
- cout<<""<<endl;
- cout<<"Continute to get card?(Y/n)";
- cin>>Player3_card_wantYN;
- cout<<""<<endl;
- //The check for player score >=21
- if(Player3_card_score==21)
- {
- cout<<"Your point is already the max 21, You shall not keep draw";
- Player3_card_wantYN='N';
- }
- if(Player3_card_score>21){
- cout<<"You already higher than 21, Please not keep draw.";
- Player3_card_wantYN='N';
- }
- }
- //Hack mode message
- if(HackMode_use==1){
- cout<< ""<<endl;
- cout<<"Hack Messager"<<endl;
- cout<<"-----------------------"<<endl;
- cout<<"Let you keep get card?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode== 'y'){
- Player1_card_wantYN='y';
- }
- else{
- cout<<"Keep the value"<<endl;
- }
- cout<<"Edit the final Point direct?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode=='y'){
- cout<<"Please key in the value you want to let it be.";
- cin>>HackMode;
- Player1_card_score=HackMode;
- }
- cout<<"-----------------------"<<endl;
- }
- /* cout<<Player3_card_wantYN;
- cout<<""<<endl; */
- //show out message
- // do not have to do after the Check score>=21 done write
- /* cout<<"The check of the pick"<<endl;
- cout<<"Amount of Player The Basic card ";
- cout<<Player3_card_score<<endl;
- cout<<"Amount of Player3's A ";
- cout<<Player3_card_A<<endl; */
- //end check
- cout<<"Here is Player3's card!!"<<endl;
- display_player_card(3);
- cout<<"This is Player3's card Sum!!"<<endl;
- cout<<Player3_card_score<<endl;
- if(Player3_card_score<=21)
- {
- cout<<"Player3 had not died!"<<endl;
- }
- else
- {
- cout<<"Player3 lose!"<<endl;
- Player3_servied=1;
- }
- system("pause");
- // Player3's game end.
- // Player4 Start
- // endllise the Player4's amounts
- int Player4_card_keep;
- int Player4_card_score;
- int Player4_card_A;
- int Player4_servied;
- char Player4_card_wantYN;
- // set the int and char's value
- Player4_card_keep=0;
- Player4_card_score=0;
- Player4_card_A=0;
- Player4_card_wantYN='y';
- Player4_servied=0;
- while(Player4_card_wantYN== 'y')
- {
- Player4_card_keep=draw(1);
- Player4_card_keep=Player4_card_keep%13;
- Player4_card_keep=Player4_card_keep+1;
- cout<<"Player4 get ";
- cout<<Player4_card_keep;
- if(Player4_card_keep>10)
- {
- Player4_card_keep=10;
- }
- if(Player4_card_keep==1)
- {
- Player4_card_A=Player4_card_A+1;
- Player4_card_keep=11;
- }
- Player4_card_score=Player4_card_score+Player4_card_keep;
- cout<<""<<endl;
- if(Player4_card_score>21)
- {
- if(Player4_card_A>=1)
- {
- Player4_card_score=Player4_card_score-10;
- Player4_card_A=Player4_card_A-1;
- }
- }
- cout<<"Player4's point is now ";
- cout<<Player4_card_score;
- cout<<""<<endl;
- cout<<"Continute to get card?(Y/n)";
- cin>>Player4_card_wantYN;
- cout<<""<<endl;
- //The check for player score >=21
- if(Player4_card_score==21)
- {
- cout<<"Your point is already the max 21, You shall not keep draw";
- Player4_card_wantYN='N';
- }
- if(Player4_card_score>21){
- cout<<"You already higher than 21, Please not keep draw.";
- Player4_card_wantYN='N';
- Player4_servied=1;
- }
- }
- //Hack mode message
- if(HackMode_use==1){
- cout<< ""<<endl;
- cout<<"Hack Messager"<<endl;
- cout<<"-----------------------"<<endl;
- cout<<"Let you keep get card?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode== 'y'){
- Player1_card_wantYN=1;
- }
- else{
- cout<<"Keep the value"<<endl;
- }
- cout<<"Edit the final Point direct?(y/n)"<<endl;
- cin>>HackMode;
- if(HackMode=='y'){
- cout<<"Please key in the value you want to let it be.";
- cin>>HackMode;
- Player1_card_score=HackMode;
- }
- cout<<"-----------------------"<<endl;
- }
- /* cout<<Player4_card_wantYN;
- cout<<""<<endl; */
- //show out message
- // do not have to do after the Check score>=21 done write
- /* cout<<"The check of the pick"<<endl;
- cout<<"Amount of Player The Basic card ";
- cout<<Player4_card_score<<endl;
- cout<<"Amount of Player4's A ";
- cout<<Player4_card_A<<endl; */
- //end check
- cout<<"Here is Player4's card!!"<<endl;
- display_player_card(4);
- cout<<"This is Player4's card Sum!!"<<endl;
- cout<<Player4_card_score<<endl;
- if(Player4_card_score<=21)
- {
- cout<<"Player4 had not died!"<<endl;
- }
- else
- {
- cout<<"Player4 lose!"<<endl;
- Player4_servied=1;
- }
- system("pause");
- // Player4's game end.
- //start the end.
- cout<<"The report for the whole game."<<endl;
- cout<<"Player1:"<<Player1_card_score<<endl;
- if( Player1_servied==1){
- cout<<"Player1 servied."<<endl;
- }
- else
- {
- cout<<"Player1 died."<<endl;
- }
- cout<<"Player2:"<<Player2_card_score<<endl;
- if( Player2_servied==1){
- cout<<"Player2 servied."<<endl;
- }
- else
- {
- cout<<"Player2 died."<<endl;
- }
- cout<<"Player3:"<<Player3_card_score<<endl;
- if( Player3_servied==1){
- cout<<"Player3 servied."<<endl;
- }
- else
- {
- cout<<"Player3 died."<<endl;
- }
- cout<<"Player4:"<<Player4_card_score<<endl;
- if( Player4_servied==1){
- cout<<"Player4 servied."<<endl;
- }
- else
- {
- cout<<"Player4 died."<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement