Advertisement
cd62131

blackjack.h

Oct 24th, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.15 KB | None | 0 0
  1. #ifndef BLACKJACK_H_
  2. #define BLACKJACK_H_
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <time.h>
  8.  
  9. #define DECK 6
  10.  
  11. typedef enum {
  12.   Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen,
  13.   King, One
  14. } kind_t;
  15.  
  16. typedef struct {
  17.   char *suit;
  18.   char *face;
  19.   kind_t kind;
  20.   int worth;
  21. } card_t;
  22.  
  23. typedef struct fighter_struct {
  24.   int value;
  25.   card_t *card;
  26.   struct fighter_struct *prev;
  27. } fighter_t;
  28.  
  29. typedef enum {
  30.   DealerBlackjack, PlayerBlackjack, DealerBust, PlayerBust, Even, DealerDuty,
  31.   DealerPass, HitOrStay
  32. } judge_t;
  33.  
  34. card_t *cards;
  35.  
  36. card_t *pull_card(void);
  37. fighter_t *hit_or_stay(fighter_t *);
  38. fighter_t *new_fighter(void);
  39. fighter_t *new_state(fighter_t *, card_t *);
  40. fighter_t *pull(fighter_t *);
  41. fighter_t *try_soft_ace(fighter_t *);
  42. int count_ace(fighter_t *);
  43. judge_t judge(fighter_t *, fighter_t *);
  44. void init_cards(void);
  45. void print_fight_without_hole(fighter_t *, fighter_t *);
  46. void print_fight(fighter_t *, fighter_t *);
  47. void print_hand(fighter_t *);
  48. void print_player(fighter_t *);
  49. void print_up(fighter_t *);
  50. void shuffle(void);
  51.  
  52. #endif /* BLACKJACK_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement