Skip to content

Instantly share code, notes, and snippets.

@Thanatossan
Created April 23, 2018 17:05
Show Gist options
  • Save Thanatossan/f4f1750dfdf232a82e60e0086c654d5f to your computer and use it in GitHub Desktop.
Save Thanatossan/f4f1750dfdf232a82e60e0086c654d5f to your computer and use it in GitHub Desktop.
void Avalon::chooseplayer(int numberofplayer,Avalon &currentplayer,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