SHARE
TWEET

The BlackJake Ver0.10.1

medal893 Dec 14th, 2016 (edited) 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include"poker_element.h"
  4. #define PLAYER 4
  5. using namespace std;
  6. int main()
  7. {
  8.    
  9.     //Basic setting
  10.     initial();
  11.     shuffle(10000);
  12.     shuffle(10000);
  13.     shuffle(10000);
  14.     shuffle(10000);
  15.     // Player2 Start  
  16.     // endllise the Player1's amounts
  17.     int Card_keep_Player[PLAYER];
  18.     int Card_score_Player[PLAYER];
  19.     int Card_A_Player[PLAYER];
  20.     char Card_wantYN_Player[PLAYER];
  21.     int Card_servied_Player[PLAYER] ;
  22.     // Hack Mode ints
  23.     char HackMode;
  24.     int HackMode_use;
  25.     int Player_Amount;
  26.     //Int the For cycle
  27.     int for_cycle;
  28.     for_cycle=1;
  29.     int f;
  30.     // set the int and char's value
  31.  
  32.    
  33.     char Explain;
  34.     cout<<"This Version is a Dev Version, Comform you not to use this Version!!"<<endl;
  35.     cout<<"Show out the Explain of this programe?(y/n)";
  36.     cin>>Explain;
  37.     if(Explain=='y'){
  38.         cout<<endl<<endl<<"The Poker Ver0.10.1 ."<<endl;
  39.         cout<<"The program would auto cancel your move while your point is >=21 even if you say keep draw."<<endl;
  40.         cout<<"Show the Message about HackMode?(y/n)";
  41.         cin>>Explain;
  42.         if(Explain=='y'){
  43.             cout<<endl<<endl<<"HackMode is a Mode for this programe that could help you cheat or Edit by hand without luck."<<endl;
  44.             cout<<"It would ask you to Enable it or not later. But it is not such easy to enable actually."<<endl;
  45.             cout<<"Hope you had a good luck"<<endl;
  46.         }
  47.         cout<<"Show out the Upgrade message?(y/n)";
  48.         cin>>Explain;
  49.         if(Explain=='y'){
  50.             cout<<endl<<endl<<"Ver0.10.1 / Upgrade for Multiplayer"<<endl;
  51.             cout<<"This upgrade is about to fix the bugs that always 1 player in 0.10 and make the ints become more effectively. "<<endl;
  52.             cout<<"The program is nearly done and going to 0.11 for the AI and the Hacker mode fix"<<endl;
  53.         }
  54.     }
  55.  
  56.     HackMode=0;
  57.     HackMode_use=0;
  58.     cout<<"Enable the Hack mode?(y/n)";
  59.     cin>>HackMode;
  60.    
  61.     if(HackMode=='a'){
  62.         cout<<"Warring! This is not yet done! Are you sure to enable it?(y/n)";
  63.         cin>>HackMode;
  64.         if(HackMode=='b'){
  65.             HackMode_use=1;
  66.         }
  67.     }
  68.  
  69.     cout<<"Show out the cards?(y/n)";
  70.     cin>>HackMode;
  71.     if(HackMode=='y'){
  72.         display_allcard();
  73.     }
  74.     cout<<"Please key in the Player Amount(1~8 Avliable now)";
  75.     cin>>Player_Amount;
  76.     cout<<endl<<"You choose "<<Player_Amount<<" Player"<<endl;
  77.    
  78.     for(f=0;f<Player_Amount;f++){
  79.         cout<<"Let's start!"<<endl;
  80.         cout<<"Start draw!!"<<endl;
  81.         // first draw
  82.         // clear the ram
  83.         Card_wantYN_Player[f]='y';
  84.         Card_keep_Player[f]=0;
  85.         Card_score_Player[f]=0;
  86.         while(Card_wantYN_Player[f] == 'y')
  87.         {
  88.             Card_keep_Player[f]=draw(1);
  89.             Card_keep_Player[f]=Card_keep_Player[f]%13;
  90.             Card_keep_Player[f]=Card_keep_Player[f]+1;
  91.             cout<<"Player"<<f<<" get ";
  92.             cout<<Card_keep_Player[f];
  93.             if(Card_keep_Player[f]>10)
  94.             {
  95.                 Card_keep_Player[f]=10;
  96.             }
  97.             if(Card_keep_Player[f]==1)
  98.             {
  99.                 Card_A_Player[f]=Card_A_Player[f]+1;
  100.                 Card_keep_Player[f]=11;
  101.             }
  102.             Card_score_Player[f]=Card_score_Player[f]+Card_keep_Player[f];
  103.            
  104.             cout<<""<<endl;
  105.             if(Card_score_Player[f]>21)
  106.             {
  107.                 if(Card_A_Player[f]>=1)
  108.                 {
  109.                     Card_score_Player[f]=Card_score_Player[f]-10;
  110.                     Card_A_Player[f]=Card_A_Player[f]-1;
  111.                 }
  112.             }
  113.            
  114.             cout<<"Player"<<f<<"'s point is now ";
  115.             cout<<Card_score_Player[f];
  116.             cout<<""<<endl;
  117.            
  118.            
  119.             cout<<"Continute to get card?(Y/n)";
  120.             cin>>Card_wantYN_Player[f] ;
  121.             cout<<""<<endl;
  122.            
  123.             //The check for player score >=21
  124.             if(Card_score_Player[f]==21)
  125.             {
  126.                 cout<<"Your point is already the max 21, You shall not keep draw";
  127.                 Card_wantYN_Player[f] ='N';
  128.             }
  129.        
  130.             if(Card_score_Player[f]>21){
  131.                 cout<<"You already higher than 21, Please not keep draw.";
  132.                 Card_wantYN_Player[f] ='N';
  133.             }
  134.         }
  135.         //Hack mode message
  136.         if(HackMode_use==1){
  137.             cout<< ""<<endl;
  138.             cout<<"Hack Messager"<<endl;
  139.             cout<<"-----------------------"<<endl;
  140.             cout<<"Let you keep get card?(y/n)"<<endl;
  141.             cin>>HackMode;
  142.             if(HackMode== 'y'){
  143.                
  144.                 Card_wantYN_Player[f] =1;
  145.              }
  146.             else{
  147.                 cout<<"Keep the value"<<endl;
  148.             }
  149.             cout<<"Edit the final Point direct?(y/n)"<<endl;
  150.             cin>>HackMode;
  151.             if(HackMode=='y'){
  152.                 cout<<"Please key in the value you want to let it be.";
  153.                 cin>>HackMode;
  154.                 Card_score_Player[f]=HackMode;
  155.             }
  156.             cout<<"-----------------------"<<endl;
  157.         }  
  158.            
  159.      
  160.     /*    cout<<Card_wantYN_Player[f] ;
  161.             cout<<""<<endl; */
  162.    
  163.             //show out message
  164.             // do not have to do after the Check score>=21 done write
  165.     /*  cout<<"The check of the pick"<<endl;
  166.         cout<<"Amount of Player The Basic card  ";
  167.         cout<<Card_score_Player[f]<<endl;
  168.         cout<<"Amount of Player[f]'s A   ";
  169.         cout<<Card_A_Player[f]<<endl;  */
  170.         //end check
  171.        
  172.        
  173.         cout<<"Here is Player"<<f<<"'s card!!"<<endl;
  174.         display_player_card(1);
  175.         cout<<"This is Player"<<f<<"s card Sum!!"<<endl;
  176.         cout<<Card_score_Player[f]<<endl;
  177.         if(Card_score_Player[f]<=21)
  178.         {
  179.             cout<<"Player"<<f<<" had not died!"<<endl;
  180.         }
  181.         else
  182.         {
  183.             cout<<"Player"<<f<<" lose!"<<endl;
  184.             Card_servied_Player[f] =1;
  185.         }
  186.         system("pause");
  187.      
  188.         // Player[f] End
  189.         Card_wantYN_Player[f] ='y';
  190.     }
  191.    
  192.  
  193.  
  194. //start the end.
  195. /*  cout<<"The report for the whole game."<<endl;
  196.     cout<<"Player1:"<<Player1_card_score<<endl;
  197.     if( Player1_servied==0){
  198.         cout<<"Player1 servied."<<endl;
  199.     }
  200.     else
  201.     {
  202.         cout<<"Player1 died."<<endl;
  203.     }
  204.     cout<<"Player2:"<<Player2_card_score<<endl;
  205.  
  206.     if( Player2_servied==0){
  207.         cout<<"Player2 servied."<<endl;
  208.     }
  209.     else
  210.     {
  211.         cout<<"Player2 died."<<endl;
  212.     }
  213.     cout<<"Player3:"<<Player3_card_score<<endl;
  214.  
  215.     if( Player3_servied==0){
  216.         cout<<"Player3 servied."<<endl;
  217.     }
  218.     else
  219.     {
  220.         cout<<"Player3 died."<<endl;
  221.     }
  222.     cout<<"Player4:"<<Player4_card_score<<endl;
  223.     if( Player4_servied==0){
  224.         cout<<"Player4 servied."<<endl;
  225.     }  
  226.     else
  227.     {
  228.         cout<<"Player4 died."<<endl;
  229.     }*/
  230.     // The Winner value
  231. /* 
  232.     if(Player1_card_score>Player2_card_score){
  233.         if(Player2_card_score>Player3_card_score){
  234.             if(Player3_card_score>Player4_card_score){
  235.                 cout<<"1st: Player1"<<endl<<"2nd: Player2"<<endl<<"3rd: Player3"<<endl<<"4th: Player4"<<endl;
  236.             }
  237.             if(Player3_card_scor
  238.            
  239.         }
  240.     }*/
  241. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top