ajout de la fonction de manger des pommes

This commit is contained in:
2023-12-17 04:09:38 +01:00
parent ec6bc5987d
commit cc1e72bee9
8 changed files with 165 additions and 97 deletions

View File

@@ -15,10 +15,10 @@ struct adresse* plateau_init(void) {
int ligne_pomme, colonne_pomme, i;
unsigned char* tete = NULL;
unsigned int* indice_queue = NULL;
unsigned int* taille_serpent = NULL;
unsigned short* indice_queue = NULL;
unsigned short* taille_serpent = NULL;
unsigned int** corps_serpent = NULL;
int** corps_serpent = NULL;
int** plateau = NULL;
@@ -42,9 +42,9 @@ struct adresse* plateau_init(void) {
/* allocation du tableau tete et queue */
tete = malloc(2*sizeof(unsigned char));
tete = malloc(2 * sizeof(unsigned char));
indice_queue = malloc(sizeof(unsigned int));
indice_queue = malloc(sizeof(unsigned short));
@@ -65,11 +65,11 @@ struct adresse* plateau_init(void) {
/* allocation du corps du serpent */
corps_serpent = malloc(TAILLE_SERPENT * sizeof(unsigned int*));
corps_serpent = malloc(TAILLE_SERPENT * sizeof(int*));
for ( i = 0; i < TAILLE_SERPENT; i++) {
corps_serpent[i] = malloc( 2 * sizeof(unsigned int));
corps_serpent[i] = malloc( 2 * sizeof(int));
}
@@ -77,7 +77,7 @@ struct adresse* plateau_init(void) {
/* allocation de la taille du serpent */
taille_serpent = malloc(sizeof(unsigned int));
taille_serpent = malloc(sizeof(unsigned short));
/* positionnement du serpent et marquage de la tete et la queue */