Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #include"poker_element.h"
- #define PLAYER 8
- using namespace std;
- int main()
- {
- //Basic setting
- initial();
- shuffle(10000);
- shuffle(10000);
- shuffle(10000);
- shuffle(10000);
- // Player2 Start
- // endllise the Player1's amounts
- int Card_keep_Player[PLAYER];
- int Card_score_Player[PLAYER];
- int Card_A_Player[PLAYER];
- char Card_wantYN_Player[PLAYER];
- int Card_servied_Player[PLAYER];
- int AI[PLAYER];
- // Hack Mode ints
- char HackMode;
- int HackMode_use;
- int Player_Amount;
- char ai;
- int ai_pos[PLAYER];
- //Int the For cycle
- int for_cycle;
- for_cycle=1;
- int f;
- // set the int and char's value
- for(f=0;f<=PLAYER;f++){
- Card_keep_Player[f]=0;
- Card_score_Player[f]=0;
- Card_A_Player[f]=0;
- Card_wantYN_Player[f]='y';
- Card_servied_Player[f]=0;
- ai_pos[f]=0;
- }
- char Explain;
- cout<<"This Version is a Dev Version, Comform you not to use this Version!!"<<endl;
- // cout<<
- cout<<"Show out the Explain of this programe?(y/n)";
- cin>>Explain;
- if(Explain=='y'){
- cout<<endl<<endl<<"The Poker Ver0.11."<<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<<endl<<endl<<"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;
- }
- cout<<"Show out the Upgrade message?(y/n)";
- cin>>Explain;
- if(Explain=='y'){
- cout<<endl<<endl<<"Ver0.11 / Upgrade for AI"<<endl;
- cout<<"The program is nearly done and going to 0.12 for the score Test"<<endl;
- }
- }
- 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<<"Show out the cards?(y/n)";
- cin>>HackMode;
- if(HackMode=='y'){
- display_allcard();
- }
- cout<<"Please key in the Player Amount(1~8 Avliable now)";
- cin>>Player_Amount;
- cout<<endl<<"You choose "<<Player_Amount<<" Player"<<endl;
- // About AI
- if(Player_Amount>=2){
- cout<<"Instill an AI in Game?(y/n)";
- cin>>ai;
- if(ai='y'){
- cout<<endl<<"You choose instill 1 AI inside game, Please choose which Player would be AI"<<endl;
- for(f=0;f<=Player_Amount;f++){
- cout<<"Player"<<f;
- cin>>ai;
- if(ai='y'){
- ai_pos[f]=1;
- break;
- }
- }
- // cin>>ai
- }
- }
- for(f=0;f<Player_Amount;f++){
- cout<<"Let's start!"<<endl;
- cout<<"Start draw!!"<<endl;
- // first draw
- while(Card_wantYN_Player[f] == 'y')
- {
- Card_keep_Player[f]=draw(1);
- Card_keep_Player[f]=Card_keep_Player[f]%13;
- Card_keep_Player[f]=Card_keep_Player[f]+1;
- cout<<"Player"<<f<<" get ";
- cout<<Card_keep_Player[f];
- if(Card_keep_Player[f]>10)
- {
- Card_keep_Player[f]=10;
- }
- if(Card_keep_Player[f]==1)
- {
- Card_A_Player[f]=Card_A_Player[f]+1;
- Card_keep_Player[f]=11;
- }
- Card_score_Player[f]=Card_score_Player[f]+Card_keep_Player[f];
- cout<<""<<endl;
- if(Card_score_Player[f]>21)
- {
- if(Card_A_Player[f]>=1)
- {
- Card_score_Player[f]=Card_score_Player[f]-10;
- Card_A_Player[f]=Card_A_Player[f]-1;
- }
- }
- cout<<"Player"<<f<<"'s point is now ";
- cout<<Card_score_Player[f];
- cout<<""<<endl;
- cout<<"Continute to get card?(Y/n)";
- cin>>Card_wantYN_Player[f] ;
- cout<<""<<endl;
- //The check for player score >=21
- if(Card_score_Player[f]==21)
- {
- cout<<"Your point is already the max 21, You shall not keep draw";
- Card_wantYN_Player[f] ='N';
- }
- if(Card_score_Player[f]>21){
- cout<<"You already higher than 21, Please not keep draw.";
- Card_wantYN_Player[f] ='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'){
- Card_wantYN_Player[f] =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;
- Card_score_Player[f]=HackMode;
- }
- cout<<"-----------------------"<<endl;
- }
- /* cout<<Card_wantYN_Player[f] ;
- 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<<Card_score_Player[f]<<endl;
- cout<<"Amount of Player[f]'s A ";
- cout<<Card_A_Player[f]<<endl; */
- //end check
- cout<<"Here is Player"<<f<<"'s card!!"<<endl;
- display_player_card(1);
- cout<<"This is Player"<<f<<"s card Sum!!"<<endl;
- cout<<Card_score_Player[f]<<endl;
- if(Card_score_Player[f]<=21)
- {
- cout<<"Player"<<f<<" had not died!"<<endl;
- }
- else
- {
- cout<<"Player"<<f<<" lose!"<<endl;
- Card_servied_Player[f] =1;
- }
- system("pause");
- // Player[f] End
- Card_wantYN_Player[f] ='y';
- }
- //start the end.
- /* cout<<"The report for the whole game."<<endl;
- cout<<"Player1:"<<Player1_card_score<<endl;
- if( Player1_servied==0){
- cout<<"Player1 servied."<<endl;
- }
- else
- {
- cout<<"Player1 died."<<endl;
- }
- cout<<"Player2:"<<Player2_card_score<<endl;
- if( Player2_servied==0){
- cout<<"Player2 servied."<<endl;
- }
- else
- {
- cout<<"Player2 died."<<endl;
- }
- cout<<"Player3:"<<Player3_card_score<<endl;
- if( Player3_servied==0){
- cout<<"Player3 servied."<<endl;
- }
- else
- {
- cout<<"Player3 died."<<endl;
- }
- cout<<"Player4:"<<Player4_card_score<<endl;
- if( Player4_servied==0){
- cout<<"Player4 servied."<<endl;
- }
- else
- {
- cout<<"Player4 died."<<endl;
- }*/
- // The Winner value
- /*
- if(Player1_card_score>Player2_card_score){
- if(Player2_card_score>Player3_card_score){
- if(Player3_card_score>Player4_card_score){
- cout<<"1st: Player1"<<endl<<"2nd: Player2"<<endl<<"3rd: Player3"<<endl<<"4th: Player4"<<endl;
- }
- if(Player3_card_scor
- }
- }*/
- }
Add Comment
Please, Sign In to add comment