-
Notifications
You must be signed in to change notification settings - Fork 3
/
deck.h
54 lines (47 loc) · 873 Bytes
/
deck.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef _DECK_H
#define _DECK_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define TOTAL 52
/**
* enum kind_e - Enumeration
* @SPADE: SPADE value
* @HEART: HEART value
* @CLUB: CLUB value
* @DIAMOND: DIAMOND value
*/
typedef enum kind_e
{
SPADE = 0,
HEART,
CLUB,
DIAMOND
} kind_t;
/**
* struct card_s - Playing card
*
* @value: Value of the card
* From "Ace" to "King"
* @kind: Kind of the card
*/
typedef struct card_s
{
const char *value;
const kind_t kind;
} card_t;
/**
* struct deck_node_s - Deck of card
*
* @card: Pointer to the card of the node
* @prev: Pointer to the previous node of the list
* @next: Pointer to the next node of the list
*/
typedef struct deck_node_s
{
const card_t *card;
struct deck_node_s *prev;
struct deck_node_s *next;
} deck_node_t;
void sort_deck(deck_node_t **deck);
#endif /*_DECK_H*/