-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblackjack.h
63 lines (54 loc) · 974 Bytes
/
blackjack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef BLACKJACK_H
#define BLACKJACK_H
#include <furi.h>
#include <gui/gui.h>
#include <input/input.h>
#include <stdlib.h>
typedef enum {
StateMenu,
StateGame,
} GameState;
typedef enum {
SuitHearts,
SuitDiamonds,
SuitClubs,
SuitSpades,
} CardSuit;
typedef enum {
RankAce = 1,
RankTwo,
RankThree,
RankFour,
RankFive,
RankSix,
RankSeven,
RankEight,
RankNine,
RankTen,
RankJack,
RankQueen,
RankKing,
} CardRank;
typedef struct {
CardSuit suit;
CardRank rank;
} Card;
typedef struct {
Card cards[10];
int card_count;
int total;
} Hand;
typedef struct {
GameState state;
Hand player;
Hand dealer;
int game_result;
bool exit;
ViewPort* view_port;
Gui* gui;
} BlackjackApp;
void deal_card(Hand* hand);
void input_callback(InputEvent* input_event, void* ctx);
void render_callback(Canvas* canvas, void* ctx);
int32_t blackjack_app(void* p);
#endif