diff --git a/prog/plateau.c b/prog/plateau.c index e68ad89..a901597 100644 --- a/prog/plateau.c +++ b/prog/plateau.c @@ -5,13 +5,38 @@ #include #include +#include #define LIGNES 40 #define COLONNES 60 +#define NBR_POMME 5 -int* plateau(void) { +int main(void) { - int tableau[LIGNES][COLONNES]; + int tableau[LIGNES][COLONNES] = {0}, ligne_pomme, colonne_pomme, indice, indice2, compteur = 0 ; + srand(time(NULL)); + + for ( indice = 0; indice < NBR_POMME; indice++) { + - return tableau; + ligne_pomme = rand() % 60; + colonne_pomme = rand() % 60; + + compteur += 1; + + tableau[ligne_pomme][colonne_pomme] = 2; + + } + + for ( indice = 0; indice < LIGNES; indice++) { + + for ( indice2 = 0; indice2 < COLONNES; indice2++) { + + printf("%d", tableau[indice][indice2]); + + } + } + printf("\n%d", compteur); + + return EXIT_SUCCESS; }