Files
SAE11_2023/snake/search_tete.c
2023-12-11 16:19:17 +01:00

39 lines
378 B
C

#include <stdlib.h>
#include <stdio.h>
#include "plateau_init.h"
int* search_tete(int* tete, int** p) {
int i, j;
/* recherche de la tête et la queue dans le tableau */
for ( i = 0; i < LIGNES; i++) {
for ( j = 0; j < COLONNES; j++) {
if ( p[i][j] == -1) {
tete[0] = i;
tete[1] = j;
p[i][j] = 1;
}
}
}
return tete;
}