Advertisement
cd62131

Blackjack in C header

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