SHARE
TWEET

The BlackJake Ver0.11

medal893 Dec 16th, 2016 (edited) 30 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 8
  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.     int AI[PLAYER];
  23.     // Hack Mode ints
  24.     char HackMode;
  25.     int HackMode_use;
  26.     int Player_Amount;
  27.     char ai;
  28.     int ai_pos[PLAYER];
  29.     //Int the For cycle
  30.     int for_cycle;
  31.     for_cycle=1;
  32.     int f;
  33.     // set the int and char's value
  34.     for(f=0;f<=PLAYER;f++){
  35.         Card_keep_Player[f]=0;
  36.         Card_score_Player[f]=0;
  37.         Card_A_Player[f]=0;
  38.         Card_wantYN_Player[f]='y';
  39.         Card_servied_Player[f]=0;
  40.         ai_pos[f]=0;
  41.     }
  42.    
  43.     char Explain;
  44.     cout<<"This Version is a Dev Version, Comform you not to use this Version!!"<<endl;
  45.  
  46. //  cout<<
  47.     cout<<"Show out the Explain of this programe?(y/n)";
  48.     cin>>Explain;
  49.     if(Explain=='y'){
  50.         cout<<endl<<endl<<"The Poker Ver0.11."<<endl;
  51.         cout<<"The program would auto cancel your move while your point is >=21 even if you say keep draw."<<endl;
  52.         cout<<"Show the Message about HackMode?(y/n)";
  53.         cin>>Explain;
  54.         if(Explain=='y'){
  55.             cout<<endl<<endl<<"HackMode is a Mode for this programe that could help you cheat or Edit by hand without luck."<<endl;
  56.             cout<<"It would ask you to Enable it or not later. But it is not such easy to enable actually."<<endl;
  57.             cout<<"Hope you had a good luck"<<endl;
  58.         }
  59.         cout<<"Show out the Upgrade message?(y/n)";
  60.         cin>>Explain;
  61.         if(Explain=='y'){
  62.             cout<<endl<<endl<<"Ver0.11 / Upgrade for AI"<<endl;
  63.             cout<<"The program is nearly done and going to 0.12 for the score Test"<<endl;
  64.         }
  65.     }
  66.  
  67.     HackMode=0;
  68.     HackMode_use=0;
  69.     cout<<"Enable the Hack mode?(y/n)";
  70.     cin>>HackMode;
  71.    
  72.     if(HackMode=='a'){
  73.         cout<<"Warring! This is not yet done! Are you sure to enable it?(y/n)";
  74.         cin>>HackMode;
  75.         if(HackMode=='b'){
  76.             HackMode_use=1;
  77.         }
  78.     }
  79.  
  80.     cout<<"Show out the cards?(y/n)";
  81.     cin>>HackMode;
  82.     if(HackMode=='y'){
  83.         display_allcard();
  84.     }
  85.     cout<<"Please key in the Player Amount(1~8 Avliable now)";
  86.     cin>>Player_Amount;
  87.     cout<<endl<<"You choose "<<Player_Amount<<" Player"<<endl;
  88.    
  89.     // About AI
  90.     if(Player_Amount>=2){
  91.  
  92.         cout<<"Instill an AI in Game?(y/n)";
  93.         cin>>ai;
  94.         if(ai='y'){
  95.             cout<<endl<<"You choose instill 1 AI inside game, Please choose which Player would be AI"<<endl;
  96.             for(f=0;f<=Player_Amount;f++){
  97.                 cout<<"Player"<<f;
  98.                 cin>>ai;
  99.                 if(ai='y'){
  100.                     ai_pos[f]=1;
  101.                     break;
  102.                 }
  103.             }
  104. //          cin>>ai
  105.            
  106.         }
  107.        
  108.     }
  109.    
  110.    
  111.    
  112.    
  113.    
  114.     for(f=0;f<Player_Amount;f++){
  115.         cout<<"Let's start!"<<endl;
  116.         cout<<"Start draw!!"<<endl;
  117.         // first draw
  118.         while(Card_wantYN_Player[f] == 'y')
  119.         {
  120.             Card_keep_Player[f]=draw(1);
  121.             Card_keep_Player[f]=Card_keep_Player[f]%13;
  122.             Card_keep_Player[f]=Card_keep_Player[f]+1;
  123.             cout<<"Player"<<f<<" get ";
  124.             cout<<Card_keep_Player[f];
  125.             if(Card_keep_Player[f]>10)
  126.             {
  127.                 Card_keep_Player[f]=10;
  128.             }
  129.             if(Card_keep_Player[f]==1)
  130.             {
  131.                 Card_A_Player[f]=Card_A_Player[f]+1;
  132.                 Card_keep_Player[f]=11;
  133.             }
  134.             Card_score_Player[f]=Card_score_Player[f]+Card_keep_Player[f];
  135.            
  136.             cout<<""<<endl;
  137.             if(Card_score_Player[f]>21)
  138.             {
  139.                 if(Card_A_Player[f]>=1)
  140.                 {
  141.                     Card_score_Player[f]=Card_score_Player[f]-10;
  142.                     Card_A_Player[f]=Card_A_Player[f]-1;
  143.                 }
  144.             }
  145.            
  146.             cout<<"Player"<<f<<"'s point is now ";
  147.             cout<<Card_score_Player[f];
  148.             cout<<""<<endl;
  149.            
  150.            
  151.             cout<<"Continute to get card?(Y/n)";
  152.             cin>>Card_wantYN_Player[f] ;
  153.             cout<<""<<endl;
  154.            
  155.             //The check for player score >=21
  156.             if(Card_score_Player[f]==21)
  157.             {
  158.                 cout<<"Your point is already the max 21, You shall not keep draw";
  159.                 Card_wantYN_Player[f] ='N';
  160.             }
  161.        
  162.             if(Card_score_Player[f]>21){
  163.                 cout<<"You already higher than 21, Please not keep draw.";
  164.                 Card_wantYN_Player[f] ='N';
  165.             }
  166.         }
  167.         //Hack mode message
  168.         if(HackMode_use==1){
  169.             cout<< ""<<endl;
  170.             cout<<"Hack Messager"<<endl;
  171.             cout<<"-----------------------"<<endl;
  172.             cout<<"Let you keep get card?(y/n)"<<endl;
  173.             cin>>HackMode;
  174.             if(HackMode== 'y'){
  175.                
  176.                 Card_wantYN_Player[f] =1;
  177.              }
  178.             else{
  179.                 cout<<"Keep the value"<<endl;
  180.             }
  181.             cout<<"Edit the final Point direct?(y/n)"<<endl;
  182.             cin>>HackMode;
  183.             if(HackMode=='y'){
  184.                 cout<<"Please key in the value you want to let it be.";
  185.                 cin>>HackMode;
  186.                 Card_score_Player[f]=HackMode;
  187.             }
  188.             cout<<"-----------------------"<<endl;
  189.         }  
  190.            
  191.      
  192.     /*    cout<<Card_wantYN_Player[f] ;
  193.             cout<<""<<endl; */
  194.    
  195.             //show out message
  196.             // do not have to do after the Check score>=21 done write
  197.     /*  cout<<"The check of the pick"<<endl;
  198.         cout<<"Amount of Player The Basic card  ";
  199.         cout<<Card_score_Player[f]<<endl;
  200.         cout<<"Amount of Player[f]'s A   ";
  201.         cout<<Card_A_Player[f]<<endl;  */
  202.         //end check
  203.        
  204.        
  205.         cout<<"Here is Player"<<f<<"'s card!!"<<endl;
  206.         display_player_card(1);
  207.         cout<<"This is Player"<<f<<"s card Sum!!"<<endl;
  208.         cout<<Card_score_Player[f]<<endl;
  209.         if(Card_score_Player[f]<=21)
  210.         {
  211.             cout<<"Player"<<f<<" had not died!"<<endl;
  212.         }
  213.         else
  214.         {
  215.             cout<<"Player"<<f<<" lose!"<<endl;
  216.             Card_servied_Player[f] =1;
  217.         }
  218.         system("pause");
  219.      
  220.         // Player[f] End
  221.         Card_wantYN_Player[f] ='y';
  222.     }
  223.    
  224.  
  225.  
  226. //start the end.
  227. /*  cout<<"The report for the whole game."<<endl;
  228.     cout<<"Player1:"<<Player1_card_score<<endl;
  229.     if( Player1_servied==0){
  230.         cout<<"Player1 servied."<<endl;
  231.     }
  232.     else
  233.     {
  234.         cout<<"Player1 died."<<endl;
  235.     }
  236.     cout<<"Player2:"<<Player2_card_score<<endl;
  237.  
  238.     if( Player2_servied==0){
  239.         cout<<"Player2 servied."<<endl;
  240.     }
  241.     else
  242.     {
  243.         cout<<"Player2 died."<<endl;
  244.     }
  245.     cout<<"Player3:"<<Player3_card_score<<endl;
  246.  
  247.     if( Player3_servied==0){
  248.         cout<<"Player3 servied."<<endl;
  249.     }
  250.     else
  251.     {
  252.         cout<<"Player3 died."<<endl;
  253.     }
  254.     cout<<"Player4:"<<Player4_card_score<<endl;
  255.     if( Player4_servied==0){
  256.         cout<<"Player4 servied."<<endl;
  257.     }  
  258.     else
  259.     {
  260.         cout<<"Player4 died."<<endl;
  261.     }*/
  262.     // The Winner value
  263. /* 
  264.     if(Player1_card_score>Player2_card_score){
  265.         if(Player2_card_score>Player3_card_score){
  266.             if(Player3_card_score>Player4_card_score){
  267.                 cout<<"1st: Player1"<<endl<<"2nd: Player2"<<endl<<"3rd: Player3"<<endl<<"4th: Player4"<<endl;
  268.             }
  269.             if(Player3_card_scor
  270.            
  271.         }
  272.     }*/
  273. }
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