TP 13 exo2: More routine for
[TD_C.git] / TP_13 / exo2 / lib / coordinates.h
diff --git a/TP_13/exo2/lib/coordinates.h b/TP_13/exo2/lib/coordinates.h
new file mode 100644 (file)
index 0000000..873d404
--- /dev/null
@@ -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 */