-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect4.h
60 lines (41 loc) · 1.54 KB
/
connect4.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
//displays start menu
void start_menu();
// create a game grid
char **create_game_grid();
// initializes the grid
void initialize_grid(char **grid);
// changes console color to the code value
void set_color(int color);
// change color of character
void color_player(char player);
// print the game grid
void print_grid(char **grid);
// update the frame by clearing the screen and printing the grid
void update_frame(char **grid);
// user input for the column number or if user wants to save or exit
int user_input(char **grid, int *player);
// validate a move in the specified column
bool validate_move(char **grid, int col);
// get the first empty row in a column
int get_first_empty(char **grid, int col);
// set the grid at the specified column and row with the player's character
void set_grid(char **grid, int col, int player);
// check the win status of the game after a move
bool game_win_status(char **grid, int player);
// check if the game is a draw
bool game_draw_status(char **grid);
// displays game draw screen to player
void game_draw_display(char **grid, int player);
// displays game end screen to player
void game_end_display(char **grid, int player);
// extracts player wins from the wins file
int *save_win(int player);
// checks if the grid is empty
// used to prevent saving an empty grid
bool check_empty_grid(char **grid);
// saves the game progress and turn
void save_game(char **grid, int player);
// loads the game from the file
int load_game(char **grid, int player);
// shows the wins for each player
void display_wins(int player);