I would like to know how I can manipulate the results for a string such that 20% of the time a string of 7 words of which one is a symbol.
This is my code so far.
I am not understanding what you need. Is it one string of seven different words or as you code make one word of seven different letters? If you want seven different words you could do something like this:
1 2 3 4 5 6
for (int lp = 0; lp < 7; lp++)
{
for (int z = 0; z < 7; z++) words += letters.at(rand() % 51);
words += " ";
}
cout << words << endl;
Of course this does nothing to include the symbol you mentioned.
sorry my apologies, so I am trying to figure out how I can produce a string of 7 random characters that has a 10% chance of mixture of numbers and letters, 10% chance of getting a mixture of symbols and letters, and 80% chance of getting just letters. This is my improvised code:
I figured a way to fix it: I replaced the else if s with just else statements.
So I am trying to make typing game where the computer generates a string of mentioned specs, then User must type the same string, however if the User misspells then he gets penalty like |G - M| = 6