X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_13%2Fexo2%2Flib%2Fcoordinates.c;h=aeea617c66bf57c20eb9c9ef27a4a470906a16e9;hb=b395a2c7d3cab0ad9935c04a92271cc67cf8c358;hp=ef80ba9d8b8bfe77da68c9d81fb73caddc2874e1;hpb=9c2b41f4a3539f1087e5560d8ceb301978f8a55b;p=TD_C.git diff --git a/TP_13/exo2/lib/coordinates.c b/TP_13/exo2/lib/coordinates.c index ef80ba9..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,10 +27,17 @@ 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? */ -/* the function do a lot of sanity checks before adding new board elements, +/* this function do a lot of sanity checks before adding new board elements, * hence the loop. moving the checks in the main loop is also possible. * for now, just branch in the main loop given this function error value returned. */ unsigned add_coordinates(coordinates_t new_coordinates, coordinates_t* coordinates_array, unsigned round) {