avancement sur le fichier deplacement.c

This commit is contained in:
2023-12-07 22:04:47 +01:00
parent 4c48419721
commit 1d7a46c3f3
3 changed files with 52 additions and 19 deletions

View File

@@ -11,21 +11,14 @@
#define NBR_POMME 5
#define TAILLE_SERPENT 10
struct serpent {
int* ;
int* queue;
}
int** plateau_init(void) {
int** plateau_init(void) {
int ligne_pomme, colonne_pomme, i;
int** tableau = NULL;
struct serpent
srand(time(NULL));
@@ -39,17 +32,21 @@ int** plateau_init(void) {
}
/* positionnement du serpent */
for (i = 0; i < TAILLE_SERPENT; i++) {
/* positionnement du serpent et marquage de la tete et la queue */
tableau[(LIGNES/2)-5][COLONNES/2] = -2;
tableau[((LIGNES/2)-5)+TAILLE_SERPENT-1][COLONNES/2] = -1;
for (i = 1; i < TAILLE_SERPENT - 1; i++) {
tableau[((LIGNES/2)-5)+i][COLONNES/2] = 1;
serpent
}
}
/* positionnement alétoire des pommes */
@@ -81,5 +78,5 @@ int** plateau_init(void) {
return tableau;
return tableau;
}