Avancement dans l'affichage graphique du tableau, mais bug rencontré dans les valeurs du tableau
This commit is contained in:
@@ -11,13 +11,25 @@
|
||||
#define NBR_POMME 5
|
||||
#define TAILLE_SERPENT 10
|
||||
|
||||
int* plateauinit(void) {
|
||||
int** plateau_init(void) {
|
||||
|
||||
int ligne_pomme, colonne_pomme, i;
|
||||
|
||||
int ** tableau = NULL;
|
||||
|
||||
int tableau[LIGNES][COLONNES] = {0}, ligne_pomme, colonne_pomme, i, i2, compteur = 0 ;
|
||||
|
||||
srand(time(NULL));
|
||||
|
||||
|
||||
/* allocation du tableau dans le tas */
|
||||
|
||||
tableau = calloc(LIGNES, sizeof(int));
|
||||
|
||||
for ( i = 0; i < LIGNES; i++) {
|
||||
|
||||
tableau[i] = calloc(COLONNES, sizeof(int));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* positionnement du serpent */
|
||||
@@ -50,11 +62,12 @@ int* plateauinit(void) {
|
||||
}
|
||||
|
||||
|
||||
/* le chiffre definit une pomme */
|
||||
/* le chiffre "2" definit une pomme */
|
||||
|
||||
tableau[ligne_pomme][colonne_pomme] = 2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user