Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef BLACKJACK_H_
- #define BLACKJACK_H_
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <time.h>
- #define DECK 6
- typedef enum {
- Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen,
- King, One
- } kind_t;
- typedef struct {
- char *suit;
- char *face;
- kind_t kind;
- int worth;
- } card_t;
- typedef struct fighter_struct {
- int value;
- card_t *card;
- struct fighter_struct *prev;
- } fighter_t;
- typedef enum {
- DealerBlackjack, PlayerBlackjack, DealerBust, PlayerBust, Even, DealerDuty,
- DealerPass, HitOrStay
- } judge_t;
- card_t *cards;
- card_t *pull_card(void);
- fighter_t *hit_or_stay(fighter_t *);
- fighter_t *new_fighter(void);
- fighter_t *new_state(fighter_t *, card_t *);
- fighter_t *pull(fighter_t *);
- fighter_t *try_soft_ace(fighter_t *);
- int count_ace(fighter_t *);
- judge_t judge(fighter_t *, fighter_t *);
- void init_cards(void);
- void print_fight_without_hole(fighter_t *, fighter_t *);
- void print_fight(fighter_t *, fighter_t *);
- void print_hand(fighter_t *);
- void print_player(fighter_t *);
- void print_up(fighter_t *);
- void shuffle(void);
- #endif /* BLACKJACK_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement