Adding irrelevant values to enums.

This commit is contained in:
Murilo Soares Pereira 2010-04-01 10:13:37 -03:00
parent f57073dc85
commit 7c3c72a0fd
2 changed files with 25 additions and 21 deletions

View File

@ -10,9 +10,9 @@ struct card *initialize_card() {
card = malloc(sizeof(card));
card->frame = initialize_frame();
card->value = NONE;
card->suit = NONE;
card->face = COVERED;
card->value = NO_VALUE;
card->suit = NO_SUIT;
card->face = NO_FACE;
return(card);
}

View File

@ -1,33 +1,37 @@
#ifndef CARD_H
#define CARD_H
enum value {
NO_VALUE = -1,
TWO = 2,
THREE = 3,
FOUR = 4,
FIVE = 5,
SIX = 6,
SEVEN = 7,
EIGHT = 8,
NINE = 9,
TEN = 10,
JACK = 11,
QUEEN = 12,
KING = 13,
ACE = 14
};
enum suit {
BLANK = -1,
NO_SUIT = -1,
DIAMONDS = 0,
SPADES = 1,
HEARTS = 2,
CLUBS = 3
};
enum value {
NONE = -1,
TWO = 2,
THREE = 3,
FOUR = 4,
FIVE = 5,
SIX = 6,
SEVEN = 7,
EIGHT = 8,
NINE = 9,
TEN = 10,
JACK = 11,
QUEEN = 12,
KING = 13,
ACE = 14
enum face {
NO_FACE = -1,
COVERED = 0,
EXPOSED = 1
};
enum face { COVERED, EXPOSED };
struct card {
struct frame *frame;
enum value value;