Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 20161111 12:36
- /*
- 追加Hack Mode用於強制修改結果
- 追加比賽結果 名次
- 尚有bug,待修復
- */
- #include<iostream>
- #include<cstdlib>
- #include"poker_element.h"
- using namespace std;
- int main()
- {
- //Basic setting
- initial();
- cout<<"Start Washing!!"<<endl;
- display_allcard();
- 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;
- display_allcard();
- cout<<"The Poker Ver0.9."<<endl;
- cout<<"The program would auto cancel your move while your point is >=21 even if you say keep draw."<<endl;
- char HackMode;
- int HackMode_use;
- HackMode=0;
- HackMode_use=0;
- cout<<"Enable the Hack mode?(y/n)";
- cin>>HackMode;
- if(HackMode=='Enable'){
- HackMode_use=1;
- }
- 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=y
- }
- 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=y
- }
- 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(1);
- 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'){
- Player3_card_wantYN=y
- }
- 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(1);
- 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'){
- Player4_card_wantYN=y
- }
- 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(1);
- 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:"<<Player1_card_score<<endl;
- if( Player2_servied==1){
- cout<<"Player2 servied."<<endl;
- }
- else
- {
- cout<<"Player2 died."<<endl;
- }
- cout<<"Player3:"<<Player1_card_score<<endl;
- if( Player3_servied==1){
- cout<<"Player3 servied."<<endl;
- }
- else
- {
- cout<<"Player3 died.";
- }
- cout<<"Player4:"<<Player1_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