All pastes #1772802 Raw Edit

Anonymous

public text v1 · immutable
#1772802 ·published 2010-01-31 06:13 UTC
rendered paste body
/*
 * PLEASE NOTE:
 * 	This deck implementation doesn't work with Jokers. It can be adapted to do so, but I won't be bothered :).
 */

#ifndef _BLACKJACK_H_
#define _BLACKJACK_H_

#define DECK_AMOUNT 2
#define DECK_SIZE (52*DECK_AMOUNT)
#define CARD_SUIT(x) (x/(13*DECK_AMOUNT))
#define CARD_NUM(x) (x%(13*DECK_AMOUNT))
#define SWAP(x, y) { x ^= y; y ^= x; x ^= y; }

#define SUIT_SPADES 0
#define SUIT_HEARTS 1
#define SUIT_DIAMONDS 2
#define SUIT_CLUBS 3

#define CARD_JACK 9
#define CARD_QUEEN 10
#define CARD_KING 11
#define CARD_ACE 12
#define CARD_NONSUIT(x) (CARD_JACK-(x-2))

int *deck_create();
void deck_reset(int *deck);
void card_print(int card);
void deck_print(int *deck);
void deck_clear(int *deck);
void deck_shuffle_std(int *deck);
void deck_faro_shuffle(int *deck);
signed char deck_deal_first(int *deck);
void deck_print_num(int *deck);

#endif