Advertisement
medal893

The BlackJack Ver0.10 Dev

Nov 17th, 2016
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.88 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include"poker_element.h"
  4. using namespace std;
  5. int main()
  6. {
  7.    
  8.     //Basic setting
  9.     initial();
  10.     shuffle(10000);
  11.     shuffle(10000);
  12.     shuffle(10000);
  13.     shuffle(10000);
  14.     // Player2 Start  
  15.     // endllise the Player1's amounts
  16.     int Player1_card_keep;
  17.     int Player1_card_score;
  18.     int Player1_card_A;
  19.     char Player1_card_wantYN;
  20.     int Player1_servied;
  21.     // Hack Mode ints
  22.     char HackMode;
  23.     int HackMode_use;
  24.     int Player_Amount;
  25.     //Int the For cycle
  26.     int for_cycle;
  27.     for_cycle=1;
  28.     // set the int and char's value
  29.     Player1_card_keep=0;
  30.     Player1_card_score=0;
  31.     Player1_card_A=0;
  32.     Player1_card_wantYN='y';
  33.     Player1_servied=0;
  34.    
  35.  
  36.    
  37.     char Explain;
  38.     cout<<"This Version is a Dev Version, Comform you not to use this Version!!"<<endl;
  39.     cout<<"Show out the Explain of this programe?(y/n)";
  40.     cin>>Explain;
  41.     if(Explain=='y'){
  42.         cout<<endl<<endl<<"The Poker Ver0.10 Dev."<<endl;
  43.         cout<<"The program would auto cancel your move while your point is >=21 even if you say keep draw."<<endl;
  44.         cout<<"Show the Message about HackMode?(y/n)";
  45.         cin>>Explain;
  46.         if(Explain=='y'){
  47.             cout<<endl<<endl<<"HackMode is a Mode for this programe that could help you cheat or Edit by hand without luck."<<endl;
  48.             cout<<"It would ask you to Enable it or not later. But it is not such easy to enable actually."<<endl;
  49.             cout<<"Hope you had a good luck"<<endl;
  50.         }
  51.         cout<<"Show out the Upgrade message?(y/n)";
  52.         cin>>Explain;
  53.         if(Explain=='y'){
  54.             cout<<endl<<endl<<"Ver0.10 Dev / Upgrade for Multiplayer"<<endl;
  55.             cout<<"This upgrade is about user to edit the amount of Player instead before's 4 player only "<<endl;
  56.             cout<<"But unfortunately, What ever you choose would always 1 player now.  This would be fix as soon as possible in 0.10.1"<<endl;
  57.         }
  58.     }
  59.  
  60.     HackMode=0;
  61.     HackMode_use=0;
  62.     cout<<"Enable the Hack mode?(y/n)";
  63.     cin>>HackMode;
  64.    
  65.     if(HackMode=='a'){
  66.         cout<<"Warring! This is not yet done! Are you sure to enable it?(y/n)";
  67.         cin>>HackMode;
  68.         if(HackMode=='b'){
  69.             HackMode_use=1;
  70.         }
  71.     }
  72.  
  73.     cout<<"Show out the cards?(y/n)";
  74.     cin>>HackMode;
  75.     if(HackMode=='y'){
  76.         display_allcard();
  77.     }
  78.     cout<<"Please key in the Player Amount(1~8 Avliable now)";
  79.     cin>>Player_Amount;
  80.     cout<<endl<<"You choose "<<Player_Amount<<"Player"<<endl;
  81.    
  82.     for(for_cycle=1;for_cycle<Player_Amount+1;for_cycle++){
  83.         cout<<"Let's start!"<<endl;
  84.         cout<<"Start draw!!"<<endl;
  85.         // first draw
  86.         while(Player1_card_wantYN== 'y')
  87.         {
  88.             Player1_card_keep=draw(1);
  89.             Player1_card_keep=Player1_card_keep%13;
  90.             Player1_card_keep=Player1_card_keep+1;
  91.             cout<<"Player1 get ";
  92.             cout<<Player1_card_keep;
  93.             if(Player1_card_keep>10)
  94.             {
  95.                 Player1_card_keep=10;
  96.             }
  97.             if(Player1_card_keep==1)
  98.             {
  99.                 Player1_card_A=Player1_card_A+1;
  100.                 Player1_card_keep=11;
  101.             }
  102.             Player1_card_score=Player1_card_score+Player1_card_keep;
  103.            
  104.             cout<<""<<endl;
  105.             if(Player1_card_score>21)
  106.             {
  107.                 if(Player1_card_A>=1)
  108.                 {
  109.                     Player1_card_score=Player1_card_score-10;
  110.                     Player1_card_A=Player1_card_A-1;
  111.                 }
  112.             }
  113.            
  114.             cout<<"Player1's point is now ";
  115.             cout<<Player1_card_score;
  116.             cout<<""<<endl;
  117.            
  118.            
  119.             cout<<"Continute to get card?(Y/n)";
  120.             cin>>Player1_card_wantYN;
  121.             cout<<""<<endl;
  122.            
  123.             //The check for player score >=21
  124.             if(Player1_card_score==21)
  125.             {
  126.                 cout<<"Your point is already the max 21, You shall not keep draw";
  127.                 Player1_card_wantYN='N';
  128.             }
  129.        
  130.             if(Player1_card_score>21){
  131.                 cout<<"You already higher than 21, Please not keep draw.";
  132.                 Player1_card_wantYN='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.                 Player1_card_wantYN=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.                 Player1_card_score=HackMode;
  155.             }
  156.             cout<<"-----------------------"<<endl;
  157.         }  
  158.            
  159.      
  160.     /*    cout<<Player1_card_wantYN;
  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<<Player1_card_score<<endl;
  168.         cout<<"Amount of Player1's A   ";
  169.         cout<<Player1_card_A<<endl;  */
  170.         //end check
  171.        
  172.        
  173.         cout<<"Here is player1's card!!"<<endl;
  174.         display_player_card(1);
  175.         cout<<"This is Player1's card Sum!!"<<endl;
  176.         cout<<Player1_card_score<<endl;
  177.         if(Player1_card_score<=21)
  178.         {
  179.             cout<<"Player1 had not died!"<<endl;
  180.         }
  181.         else
  182.         {
  183.             cout<<"Player1 lose!"<<endl;
  184.             Player1_servied=1;
  185.         }
  186.         system("pause");
  187.      
  188.         // Player1 End
  189.         Player1_card_wantYN='y';
  190.     }
  191.    
  192.  
  193.  
  194.  
  195. //start the end.
  196. /*  cout<<"The report for the whole game."<<endl;
  197.     cout<<"Player1:"<<Player1_card_score<<endl;
  198.     if( Player1_servied==0){
  199.         cout<<"Player1 servied."<<endl;
  200.     }
  201.     else
  202.     {
  203.         cout<<"Player1 died."<<endl;
  204.     }
  205.     cout<<"Player2:"<<Player2_card_score<<endl;
  206.  
  207.     if( Player2_servied==0){
  208.         cout<<"Player2 servied."<<endl;
  209.     }
  210.     else
  211.     {
  212.         cout<<"Player2 died."<<endl;
  213.     }
  214.     cout<<"Player3:"<<Player3_card_score<<endl;
  215.  
  216.     if( Player3_servied==0){
  217.         cout<<"Player3 servied."<<endl;
  218.     }
  219.     else
  220.     {
  221.         cout<<"Player3 died."<<endl;
  222.     }
  223.     cout<<"Player4:"<<Player4_card_score<<endl;
  224.     if( Player4_servied==0){
  225.         cout<<"Player4 servied."<<endl;
  226.     }  
  227.     else
  228.     {
  229.         cout<<"Player4 died."<<endl;
  230.     }*/
  231.     // The Winner value
  232. /* 
  233.     if(Player1_card_score>Player2_card_score){
  234.         if(Player2_card_score>Player3_card_score){
  235.             if(Player3_card_score>Player4_card_score){
  236.                 cout<<"1st: Player1"<<endl<<"2nd: Player2"<<endl<<"3rd: Player3"<<endl<<"4th: Player4"<<endl;
  237.             }
  238.             if(Player3_card_scor
  239.            
  240.         }
  241.     }*/
  242. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement