This commit is contained in:
2024-12-12 18:54:13 +01:00
parent f561985efe
commit 0f018cd3af
2 changed files with 1 additions and 5 deletions

2
main.c
View File

@@ -6,7 +6,7 @@
int main()
{
vect *playerPos = (vect *)malloc(sizeof(vect));
vect *targets = malloc(sizeof(vect));
vect *targets;
int nbr_targets;
unsigned short int **tab2d = creatArea2D(32);
targets = fileToTab2D("test.txt", tab2d, 32, playerPos, &nbr_targets);

4
read.c
View File

@@ -23,12 +23,8 @@ fileToTab2D (const char *name_file, unsigned short int **tab, const unsigned N,
break;
case '.':
targets = realloc (targets, sizeof (vect) * (++nbr_targets[0]));
printf ("nbr %d, pointeur %p\n", nbr_targets[0], targets);
targets[nbr_targets[0] - 1].x = x;
printf ("%d : %d\n", targets[nbr_targets[0] - 1].x,
nbr_targets[0] - 1);
targets[nbr_targets[0] - 1].y = y;
printf ("%d\n", targets[nbr_targets[0] - 1].y);
tab[x][y] = TARGET;
break;
case '@':