Get Solutions for: wRITE A PSEUDOCODE FOR THIS PROGRAM #include #include #include #include #define MAX_PASSES 3 /*const

wRITE A PSEUDOCODE FOR THIS PROGRAM
#include
#include
#include
#include
#define MAX_PASSES 3 /*constant for maximum number ofpasses*/
int turn=0; /*variable to keep the track of turns*/
int passesLeft[]={MAX_PASSES,MAX_PASSES}; /*array to hold thepasses left for two players*/
int previouslyPassed[]={0,0}; /*another array, to denote if theplayer has previously passed a turn (continuously)*/
/*method to prompt the user and receive the player number(either 1 or 2)*/
int getPlayerNumber(){
               int num=0;
               printf(“Player Number: “);
               scanf(“%d”,&num);
               fflush(stdin); /*flushing the buffer*/
               if(num==turn){
                               /*valid player number*/
                               return num;
               }else{
                               if(num==1 || num==2){
                                               /*not the right turn*/
                                               printf(“You have to wait for yourturnn”);                                          
                               }else{
                                               /*entered something other than 1 and 2*/
                                               printf(“Invalid number, try again!n”);
                               }
                               /*prompt again and return*/
                               return getPlayerNumber();
               }
}
/*method to prompt the user to enter a guess and return it*/
int getGuess(){
               printf(“Enter your guess: “);
               char text[10];
               /*getting guess as text*/
               scanf(“%s”,&text);
               if(strcmp(text,”PASS”)==0){
                               /*player entered PASS, returning -1 to denote PASS*/
                              return -1;
               }else{
                               /*converting text to integer and returning it*/
                               int num=atoi(text);
                               return num;
               }
}
int main(){
               /*seeding random number generator*/
               srand(time(NULL));
               /*generating a number between 1 and 100*/
               int number=rand()%100 +1;
               /*deciding which player should play first, will generate eithe 1 or2*/
               turn=rand()%2 +1;
               printf(“Player %d will play firstn”,turn);
               /*variable to keep the track of user guess*/
               int guess=0;
               /*loops until the right guess is entered*/
               while(guess!=number){
                               /*getting valid player number*/
                               int p=getPlayerNumber();
                               /*getting guess*/
                               guess=getGuess();
                               if(guess==-1){
                                               /*player choose to PASS*/
                                               if(passesLeft[p-1]==0){
                                                               /*no passes left*/
                                                               printf(“You dont have any passes left!n”);
                                               }else{
                                                               /*checking if the player passed a turn consecutively*/
                                                               if(previouslyPassed[p-1]==1){
                                                                               printf(“You cant pass for two times in a row!n”);
                                                               }else{
                                                                               /*passing the turn, decrementing the passes left*/
                                                                               passesLeft[p-1]–;
                                                                               /*displaying the remaining pass details*/
                                                                               printf(“You have passed %d number of times, you have %d more timesleftn”,MAX_PASSES-passesLeft[p-1],passesLeft[p-1]);
                                                                               /*setting a flag in previouslyPassed array to show that the playerhas passes a turn */
                                                                               previouslyPassed[p-1]=1;
                                                                               /*swapping the turns*/
                                                                               if(turn==1){
                                                                                               turn=2;
                                                                               }else{
                                                                                               turn=1;
                                                                               }
                                                               }
                                               }
                               }else{
                                               /*checking if the guess is higher than the number*/
                                               if(guess>number){
                                                               printf(“Too high!n”);
                                               }else if(guess Attached