Programming in C, microsoft visual studios, Dice Poker

1 answer below »

Programming in C, microsoft visual studios, Dice Poker



Answered Same DayMay 06, 2021

Answer To: Programming in C, microsoft visual studios, Dice Poker

Aditi answered on May 10 2021
148 Votes
Higcs001_dice_poker.c
#include
#include
#include
#define TOTAL_DICE 5
/*Function display_hand to display the face value of di
ce to the screen.
this function takes an array of integers as a parameter (i.e. the values of the five
die to display) and displays the dice to the screen.
Parameters: Array storing five die face values.
Returns: Nothing is returned from the functions. */
void display_hand(int hand[], int max_dice){
    
    int i;
    
    printf("\n%16s", "");
    for(i=0; i        printf("Die %-4d", i+1);
    }
    printf("\n%12s", "");
    printf(" ");
    
    for(i=0; i        printf("[%d] ", hand[i]);
    }
    printf("\n%12s", "");
    
    for(i=0; i        if(hand[i] == 1)
            printf("%8s", "");
        else if(hand[i] == 2 || hand[i] == 3)
            printf("%8s", "* ");
        else if(hand[i] == 4 || hand[i] == 5 || hand[i] == 6)
            printf("%8s", "* *");
    }
    printf("\n%12s", "");
    
    for(i=0; i        if(hand[i] == 1 || hand[i] == 3 || hand[i] == 5)
            printf("%8s", "* ");
        else if(hand[i] == 4 || hand[i] == 2)
            printf("%8s", " ");
        else if(hand[i] == 6)
            printf("%8s", "* *");
    }
    printf("\n%12s", "");
    
    for(i=0; i        if(hand[i] == 1)
            printf("%8s", " ");
        else if(hand[i] == 2 || hand[i] == 3)
            printf("%8s", "* ");
        else if(hand[i] == 4 || hand[i] == 5 || hand[i] == 6)
            printf("%8s", "* *");
    }
    printf("\n\n");
}
//display_details function display my details on the screen
void display_details(void){
    printf("\nFile :...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here