-
Notifications
You must be signed in to change notification settings - Fork 1
/
scores.h
68 lines (61 loc) · 3.47 KB
/
scores.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
64
65
66
67
68
#ifndef SCORES_AND_AI_H
#define SCORES_AND_AI_H
#include "scores.c"
/// @brief Function checks if the play connects 4 horizontally and returns the changes in score "aka: score_after - score_before"
/// @param height height of the board
/// @param width width of the board
/// @param board the game- board 2-D array
/// @param move the column's index
/// @param moves_stack the stack containing all the moves of the game
/// @param score the score of player
/// @param moves_count count of moves till now
/// @param symbol symbol of the player
/// @param row row's index of the play
/// @return returns the changes in score "aka: score_after - score_before"
int connect4Horizontally(configurations config, char board[][config.width], int move, int *score, char symbol, int row);
/// @brief Function checks if the play connects 4 vertically and returns the changes in score "aka: score_after - score_before"
/// @param height height of the board
/// @param width width of the board
/// @param board the game- board 2-D array
/// @param move the column's index
/// @param score the score of player
/// @param moves_count count of moves till now
/// @param symbol symbol of the player
/// @param row row's index of the play
/// @return returns the changes in score "aka: score_after - score_before"
int connect4Vertically(configurations config, char board[][config.width], int move, int *score, char symbol, int row);
/// @brief Function checks if the play connects 4 in this "/" direction and returns the changes in score "aka: score_after - score_before"
/// @param height height of the board
/// @param width width of the board
/// @param board the game- board 2-D array
/// @param move the column's index
/// @param score the score of player
/// @param moves_count count of moves till now
/// @param symbol symbol of the player
/// @param row row's index of the play
/// @return returns the changes in score "aka: score_after - score_before"
int connect4RightDiagonal(configurations config, char board[][config.width], int move, int *score, char symbol, int row);
/// @brief Function checks if the play connects 4 in this direction "\\" and returns the changes in score "aka: score_after - score_before"
/// @param height height of the board
/// @param width width of the board
/// @param board the game- board 2-D array
/// @param move the column's index
/// @param score the score of player
/// @param moves_count count of moves till now
/// @param symbol symbol of the player
/// @param row row's index of the play
/// @return returns the changes in score "aka: score_after - score_before"
int connect4LeftDiagonal(configurations config, char board[][config.width], int move, int *score, char symbol, int row);
/// @brief Function checks the change in score and edits the score according to the move in all directions
/// @param height height of the board
/// @param width width of the board
/// @param board the game- board 2-D array
/// @param move the column's index
/// @param moves_stack the stack containing all the moves of the game
/// @param score the score of player
/// @param moves_count count of moves till now
/// @param symbol symbol of the player
/// @param to_undo if the user made undo, becomes = 1 if the user made undo
/// @param mode the game-mode
void isConnect4(configurations config, char board[][config.width], int move, int *score, int moves_stack[], int moves_count, char symbol, int to_undo, int mode);
#endif