Question: in c create a function that will assess the value of any card from the deck. Use the Black Jack rules for the card values.
in c create a function that will assess the value of any card from the deck.
Use the Black Jack rules for the card values.
Hint: Cards will have string names. You will convert those to specific values based on the rules of the game.
Make sure that you have a function that receives a card and then will return the value of that card.
#include
#include
#include
#define DECKSIZE
const char suitsHearts "Diamonds", "Clubs", "Spades";
const char ranks "Jack", "Queen", "King", "Ace";
typedef struct
const char rank;
const char suit;
Card;
void generateDeckCard deck
int i j k ;
for i ; i ; i
for j ; j ; j
deckkrank ranksj;
deckksuit suitsi;
k;
void shuffleDeckCard deck
int i;
for i ; i DECKSIZE; i
int randomIndex rand DECKSIZE;
Card temp decki;
decki deckrandomIndex;
deckrandomIndex temp;
void displayDeckconst Card deck
int i;
for i ; i DECKSIZE; i
printfs of s
deckirank, deckisuit;
int main
Card deckDECKSIZE;
srandtime;
generateDeckdeck;
printfOriginal Deck:
;
displayDeckdeck;
shuffleDeckdeck;
printf
Shuffled Deck:
;
displayDeckdeck;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
