diff --git a/display.c b/display.c index 8f5f21a..45b8ff0 100644 --- a/display.c +++ b/display.c @@ -1,17 +1,17 @@ -#include #include "display.h" +#include -void screenDisplay( unsigned short int **tab,int size) +void +screenDisplay (unsigned short int **tab, int size) { - //puts("0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 "); - char element[7] ={' ','#','S','.','*','@','+'} ; - for(int i=0;i -#include +#include "display.h" #include "function.h" #include "read.h" -#include "display.h" +#include +#include #define SIZE_PLAY 24 -int main() +int +main () { - vect *playerPos = (vect *)malloc(sizeof(vect)); + vect *playerPos = (vect *)malloc (sizeof (vect)); vect *targets; int nbr_targets; score playerScore; - playerScore.before = time(NULL); - unsigned short int **tab2d = creatArea2D(SIZE_PLAY); - targets = fileToTab2D("test.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets); - screenDisplay(tab2d, SIZE_PLAY); - inGameLoop(tab2d, SIZE_PLAY, playerPos, targets, nbr_targets); + playerScore.before = time (NULL); + unsigned short int **tab2d = creatArea2D (SIZE_PLAY); + targets + = fileToTab2D ("test.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets); + screenDisplay (tab2d, SIZE_PLAY); + inGameLoop (tab2d, SIZE_PLAY, playerPos, targets, nbr_targets); - - playerScore.after = time(NULL); - printf("%ld\n", playerScore.after - playerScore.before); - free2D(tab2d, SIZE_PLAY); - free(playerPos); - free(targets); + playerScore.after = time (NULL); + printf ("%ld\n", playerScore.after - playerScore.before); + free2D (tab2d, SIZE_PLAY); + free (playerPos); + free (targets); return 0; } diff --git a/read.c b/read.c index 821ea73..3fbdff3 100644 --- a/read.c +++ b/read.c @@ -48,6 +48,6 @@ fileToTab2D (const char *name_file, unsigned short int **tab, const unsigned N, exit (-1); } } - fclose(file); + fclose (file); return targets; } diff --git a/read.h b/read.h index 0160396..26bcc3d 100644 --- a/read.h +++ b/read.h @@ -1,6 +1,6 @@ #ifndef READ_H #define READ_H #include "function.h" -vect* fileToTab2D(const char* name_file, unsigned short int **tab, - const unsigned N, vect *player, int *nbr_targets); +vect *fileToTab2D (const char *name_file, unsigned short int **tab, + const unsigned N, vect *player, int *nbr_targets); #endif // !READ_H