Cleanups.
[TD_C.git] / coordinates.h
... / ...
CommitLineData
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#include <stdbool.h>
23
24/* we only have nine elements in the grid */
25#define MAX_COORDINATES 9
26
27typedef struct coordinates_s {
28 int y;
29 int x;
30 unsigned type; /* 0 = O, 1 = X */
31} coordinates_t;
32
33void init_coordinates(coordinates_t* coordinates_array);
34coordinates_t set_coordinates(int y, int x, unsigned type);
35unsigned add_coordinates(coordinates_t new_coordinates, coordinates_t* coordinates_array, unsigned round);
36bool chk_win_conditions(coordinates_t* coordinates_array, unsigned round);
37
38#endif /* COORDINATES_H */