Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Generisanje slucajnog slova (CPU mode)
- int randomSlovo()
- {
- char slova[22] = "abcdefghijklmnoprstuvz";
- /*
- char used[11] = {"x"};
- char rndSlovo;
- int i, j;
- bool ok;
- for (i = 0; i <= 10; i++)
- {
- do
- {
- ok = true;
- rndSlovo = slova[rand() % (22)];
- for (j = 0; j <= 10; j++)
- {
- if (used[j] != '\0')
- {
- if (rndSlovo == used[j])
- ok = false;
- }
- else
- {
- ok = false;
- }
- }
- }
- while (!ok);
- used[i] = rndSlovo;
- return used[i];
- }
- */
- srand(time(NULL));
- return slova[rand() % (22)];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement