how to make a name from random numbers?
- by blood
my program makes a random name that could have a-z this code makes a 16 char name but
:( my code wont make the name and idk why :( can anyone show me what's wrong with this?
char name[16];
void make_random_name()
{
byte loop = -1;
for(;;)
{
loop++;
srand((unsigned)time(0));
int random_integer;
random_integer = (rand()%10)+1;
switch(random_integer)
{
case '1': name[loop] = 'A';
break;
case '2': name[loop] = 'B';
break;
case '3': name[loop] = 'C';
break;
case '4': name[loop] = 'D';
break;
case '5': name[loop] = 'E';
break;
case '6': name[loop] = 'F';
break;
case '7': name[loop] = 'G';
break;
case '8': name[loop] = 'Z';
break;
case '9': name[loop] = 'H';
break;
}
cout << name << "\n";
if(loop > 15)
{
break;
}
}
}