tty-solitaire/debug/card_debug.c

43 lines
1.3 KiB
C
Raw Normal View History

#include <stdio.h>
2010-04-10 16:49:19 +00:00
#include "card_debug.h"
void print_card(struct card *card) {
switch (card->face) {
case NO_FACE: printf("No face "); break;
case COVERED: printf("Covered "); break;
case EXPOSED: printf("Exposed "); break;
2010-04-11 20:13:06 +00:00
default : printf("? ");
}
switch (card->value) {
case NO_VALUE: printf(", no value "); break;
2010-04-11 20:13:06 +00:00
case TWO : printf("two "); break;
case THREE : printf("three "); break;
case FOUR : printf("four "); break;
2010-04-11 20:13:06 +00:00
case FIVE : printf("five "); break;
case SIX : printf("six "); break;
case SEVEN : printf("seven "); break;
case EIGHT : printf("eight "); break;
case NINE : printf("nine "); break;
case TEN : printf("ten "); break;
case JACK : printf("jack "); break;
case QUEEN : printf("queen "); break;
case KING : printf("king "); break;
case ACE : printf("ace "); break;
2010-04-11 20:13:06 +00:00
default : printf("? ");
}
switch (card->suit) {
case NO_SUIT : printf(", no suit "); break;
case DIAMONDS: printf("of diamonds "); break;
case SPADES : printf("of spades "); break;
case HEARTS : printf("of hearts "); break;
case CLUBS : printf("of clubs "); break;
}
printf("at y:%d x:%d, ", card->frame->start_y, card->frame->start_x);
printf("with width:%d height:%d\n", FRAME_WIDTH, FRAME_HEIGHT);
return;
}