From: Jerome Benoit Date: Thu, 24 Aug 2017 16:45:53 +0000 (+0200) Subject: Reorder functions list. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bbf5487f8cae3e6643f1d40be6aaa7164bae5cc5;p=TD_C.git Reorder functions list. --- diff --git a/TP_13/exo2/lib/coordinates.c b/TP_13/exo2/lib/coordinates.c index fc5cb4f..aeea617 100644 --- a/TP_13/exo2/lib/coordinates.c +++ b/TP_13/exo2/lib/coordinates.c @@ -18,13 +18,6 @@ #include "coordinates.h" -void zero_coordinates(coordinates_t* coordinates_array) { - - for (unsigned i = 0; i < MAX_COORDINATES; i++) { - coordinates_array[i] = set_coordinates(0, 0, 0); - } -} - coordinates_t set_coordinates(int y, int x, unsigned type) { coordinates_t new_coordinates; @@ -34,6 +27,13 @@ coordinates_t set_coordinates(int y, int x, unsigned type) { return new_coordinates; } +void zero_coordinates(coordinates_t* coordinates_array) { + + for (unsigned i = 0; i < MAX_COORDINATES; i++) { + coordinates_array[i] = set_coordinates(0, 0, 0); + } +} + /* FIXME: Does it worth doing a coordinates_t get_coordinates(int y, int x, unsigned type); helper function? */ /* Or a int get_coordinates_x(coordinates_t coordinates); helper function? */ diff --git a/TP_13/exo2/lib/coordinates.h b/TP_13/exo2/lib/coordinates.h index c549d2e..f17d2cc 100644 --- a/TP_13/exo2/lib/coordinates.h +++ b/TP_13/exo2/lib/coordinates.h @@ -30,8 +30,8 @@ typedef struct coordinates_s { unsigned type; /* 0 = O, 1 = X */ } coordinates_t; -void zero_coordinates(coordinates_t* coordinates_array); coordinates_t set_coordinates(int y, int x, unsigned type); +void zero_coordinates(coordinates_t* coordinates_array); unsigned add_coordinates(coordinates_t new_coordinates, coordinates_t* coordinates_array, unsigned round); bool chk_win_conditions(coordinates_t* coordinates_array, unsigned round);