Created
April 23, 2018 17:05
-
-
Save Thanatossan/f4f1750dfdf232a82e60e0086c654d5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Avalon::chooseplayer(int numberofplayer,Avalon ¤tplayer,int votephase1count){ | |
int n; char vote; bool pass =0; | |
if(player.king==1)//if player are king | |
{ | |
do{ | |
if(votephase1count ==5) // In case of decline 5 time | |
{ | |
return calscore('B'); | |
} | |
cout << "Choose player to go" ; | |
cin >> n; | |
cout << "other player vote"; | |
bot(numberofplayer,'c'); //send to bot function | |
if(approve >= numberofplayer/2){ | |
return votephase2(numberof player); | |
} | |
else{ | |
votephase1count++; | |
pass=0; | |
} | |
}while(pass=0); | |
} | |
else{ | |
do{ | |
if(votephase1count ==5){ | |
return calscore('B'); | |
} | |
do{ | |
cout << "Press A to Approve or Press D to Decline"; | |
cin >> vote; | |
}while(vote!='A' || vote !='D'); | |
bot(numberofplayer,1) | |
if(approve >= numberofplayer/2){ | |
pass=1 ; | |
return votephase2(numberofplayer); | |
} | |
else{ | |
votephase1count++; | |
pass=0; | |
} | |
}while(pass=0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment