+static bool chk_line(coordinates_t* coordinates_array, int line_number, unsigned round) {
+ unsigned nb_o_align = 0;
+ unsigned nb_x_align = 0;
+
+ for (unsigned i = 0; i <= round; i++) {
+ /* check if they are all the same */
+ if ((coordinates_array + i)->y == line_number && (coordinates_array + i)->type == 0) {
+ nb_o_align++;
+ }
+ if ((coordinates_array + i)->y == line_number && (coordinates_array + i)->type == 1) {
+ nb_x_align++;
+ }
+ }
+ if (nb_o_align == 3 || nb_x_align == 3) {
+ return true;
+ }
+ return false;
+}
+
+static bool chk_column(coordinates_t* coordinates_array, int column_number, unsigned round) {
+ unsigned nb_o_align = 0;
+ unsigned nb_x_align = 0;
+
+ for (unsigned i = 0; i <= round; i++) {
+ /* check if they are all the same */
+ if ((coordinates_array + i)->x == column_number && (coordinates_array + i)->type == 0) {
+ nb_o_align++;
+ }
+ if ((coordinates_array + i)->x == column_number && (coordinates_array + i)->type == 1) {
+ nb_x_align++;
+ }
+ }
+ /* one column must be full of the same type */
+ if (nb_o_align == 3 || nb_x_align == 3) {
+ return true;
+ }
+ return false;
+}
+
+static bool chk_diagonals(coordinates_t* coordinates_array, unsigned round) {
+ unsigned nb_o_diag_one = 0, nb_o_diag_two = 0;
+ unsigned nb_x_diag_one = 0, nb_x_diag_two = 0;