# how to generate unique random number between 0 and 10

i have array filled with 10 strings d[]={"strint1",string2",................................}
and i have empty array
i want to fill the empty array with strings from array d but randomly
and i dont want the same string to be filled

i tried this code
//#include <LiquidCrystal.h>
char* s[]={"string1","string2","string3","string4","string5"};
char* genWords[5];
int rounds;
const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;
//LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int bstatus=1;
uint8_t counter=0;
bool gameStatus=false;
int tones[]={300,600,900,1200,1500};

int bpin=1;
int buzzPin=2;

void setup() {
pinMode(bpin,INPUT_PULLUP);
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

if(gameStatus==false){
gameStatus=true;
beginsq();
rounds=0;
ranOrder();
}
while(rounds<5){// lcd.setCursor(0, 0);
//lcd.clear();
//lcd.print(genWords[rounds]);

if(millis()-counter>30000){
counter=millis();
if(bstatus==1){
losesq();
gameStatus=false;
}
}
nextsq();
rounds++;
bstatus=0;
}
else { bstatus=1;}

}
if(rounds>5){
winsq();
gameStatus=false;
}

}

void nextsq(){
for(int y=0;y<5;y++){
tone(buzzPin,tones[y],150);
}

}
void losesq(){
for(int y=0;y<5;y++){
tone(buzzPin,tones[y],150);
}

}
void winsq(){
for(int y=0;y<5;y++){
tone(buzzPin,tones[y],150);
}

}
void beginsq(){
for(int y=0;y<5;y++){
tone(buzzPin,tones[y],150);
}

}

// to generate random order

void ranOrder(){
int j;
int i;
int k;
int c;
int o;
// s1 s2 s2 s3 s4
for(i=0;i<4;i++){
j=round(random(0,5));
genWords=s[j];
}
for(k=0;k<=4;k++){
for(o=0;o<=4;o++){if(k==o){continue;}
if(genWords[k]==genWords
){

do{
c=round(random(0,5));
genWords[k]=s

``````;

}while(genWords[k]==genWords
);

}

}

}
}
``````

Now, hopefully, you can see why we ask you to use code tags when posting code.

Once you have figured out how to post code properly, please post all of it.

i want to fill the empty array with strings from array d but randomly

Consider other approaches, such as a randomly arranged list of indices to the original strings (the operation is called shuffling).

i want to fill the empty array with strings from array d but randomly
and i dont want the same string to be filled

It would be much better to put index numbers to the first array in the second one rather than copy strings around and it is also much easier to check whether an index number has previously been used.

Use code tags when posting code.