First off, I'm not going off to grab a copy of your whole code, and wade through it looking for the relevant bits. If you want to show us your code don't be lazy: copy'n'paste the relevant fragments and post them here as text - using the "code" widget to enable the syntax highlighter.
Then explain exactly what you did and what happened that you didn't expect or didn't happen that you did.
Probably, you haven't initialized the random number generator:
int main()
{
srand(time(NULL));
return 0;
}
int numberOfDifferentValues = 5;
for (int i = 0; i < 10; i++)
{
int r = rand() % numberOfDifferentValues;
printf("%u\n", r);
}
Will give you twenty random values between 0 and 4 inclusive.
If you want those random value to be unique, then create an array containing the values you can use and use the random number to index that array (for a ten letter word):
int numberOfDifferentValues = 5;
int valid[10] = {0, 1, 2, 3, 4, 5, 6, 7 , 8, 9};
int indexes = 10;
for (int i = 0; i < numberOfDifferentValues; i++)
{
int r = rand() % indexes;
printf("%u\n", valid[r]);
indexes--;
valid[r] = valid[indexes];
}