Commit | Line | Data |
---|---|---|
5df3071e JB |
1 | /* |
2 | * ===================================================================================== | |
3 | * | |
4 | * Filename: coordinates.h | |
5 | * | |
6 | * Description: Header for data definition and functions to manipulate elements in the grid | |
7 | * | |
8 | * Version: 1.0 | |
9 | * Created: 16/03/2017 19:06:16 | |
10 | * Revision: none | |
11 | * Compiler: gcc | |
12 | * | |
13 | * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org | |
14 | * Organization: Piment Noir | |
15 | * | |
16 | * ===================================================================================== | |
17 | */ | |
18 | ||
19 | #ifndef COORDINATES_H | |
20 | #define COORDINATES_H | |
21 | ||
22 | /* we only have nine elements in the grid */ | |
23 | #define MAX_COORDINATES 9 | |
24 | ||
25 | typedef struct coordinates_s { | |
26 | int y; | |
27 | int x; | |
28 | unsigned type; /* 0 = O, 1 = X */ | |
29 | } coordinates_t; | |
30 | ||
31 | void init_coordinates(coordinates_t* coordinates_array); | |
32 | coordinates_t set_coordinates(int y, int x, unsigned type); | |
33 | unsigned add_coordinates(coordinates_t new_coordinates, coordinates_t* coordinates_array); | |
34 | ||
35 | #endif /* COORDINATES_H */ |