forked from CPRF-Session2/Assignment6
/
cards.c
39 lines (30 loc) · 835 Bytes
/
cards.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Mariposa Lee, drawing 5 random cards, incomplete. I started over twice, but at the end I couldn't figure it out. Tried in enums first, but then got confused, so I tried to do it with strings...*/
#include <stdio.h>
#include <string.h>
enum suits {hearts, diamonds, spades, clubs};
enum values {two, three, four, five, six, seven, eight, nine, ten, Queen, Joker, King, Ace};
struct Cards {
enum values value;
enum suits suit;
};
/*
char s1[4]= "hearts", "diamonds", "spades", "clubs";
char s2[13]= "2", "3", "4", "5", "6", "7", "8", "9", "10", "Queen", "Joker", "King", "Ace";
*/
typedef struct card Cards;
drawCard(int values) {
int s;
s=srand()%13;
}
getSuit(int values){
int l;
l=srand()%4;
}
int main () {
int q, w;
char values, suits;
q = drawCard(values);
w= getSuit(suits);
printf("%d of %s", q, w);
return 0;
}