diff --git a/grille.c b/grille.c new file mode 100644 index 0000000..6317c2d --- /dev/null +++ b/grille.c @@ -0,0 +1,29 @@ +#include +#include +#include + +int* grille(int taille) { + srand(time(NULL)); + int i,j; + int coos[2]; + int tab[taille][taille] = {}; + coos[0] = rand()%taille; + coos[1] = rand()%taille; + for (i=0;i<6;i++){ + for (j=0;j<6;j++){ + tab[i][j] = -1; + } + } + for (i=0;i<18;i++){ + for (j=0;j<2;j++){ + while (tab[coos[0]][coos[1]] != -1){ + coos[0] = rand()%6; + coos[1] = rand()%6; + } + tab[coos[0]][coos[1]] = i; + } + } + return tab; +} + +