X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_13%2Fexo2%2Flib%2Fcoordinates.h;fp=TP_13%2Fexo2%2Flib%2Fcoordinates.h;h=873d404735e9325853fff3703a8c636df4798520;hb=5df3071eec60ca43bc66e1266820de0572d4b629;hp=0000000000000000000000000000000000000000;hpb=aae22ca298198e5791490702bfceefd78a0140b2;p=TD_C.git diff --git a/TP_13/exo2/lib/coordinates.h b/TP_13/exo2/lib/coordinates.h new file mode 100644 index 0000000..873d404 --- /dev/null +++ b/TP_13/exo2/lib/coordinates.h @@ -0,0 +1,35 @@ +/* + * ===================================================================================== + * + * Filename: coordinates.h + * + * Description: Header for data definition and functions to manipulate elements in the grid + * + * Version: 1.0 + * Created: 16/03/2017 19:06:16 + * Revision: none + * Compiler: gcc + * + * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org + * Organization: Piment Noir + * + * ===================================================================================== + */ + +#ifndef COORDINATES_H +#define COORDINATES_H + +/* we only have nine elements in the grid */ +#define MAX_COORDINATES 9 + +typedef struct coordinates_s { + int y; + int x; + unsigned type; /* 0 = O, 1 = X */ +} coordinates_t; + +void init_coordinates(coordinates_t* coordinates_array); +coordinates_t set_coordinates(int y, int x, unsigned type); +unsigned add_coordinates(coordinates_t new_coordinates, coordinates_t* coordinates_array); + +#endif /* COORDINATES_H */