[Solved] is there a way randomly separate a string into different string array and get back same same string [closed]

Assuming that the request for a “random” allocation of letters to arrays is for a pseudo-random (or, perhaps, a superficially arbitrary) allocation that is therefore reversible, one technique to do this would be to essentially use a transposition cipher. The algorithm would then be something like: Run the transposition cipher on the input text. Split … Read more

[Solved] C++, twenty numbers not random? [closed]

You need to call rand() each time you want a random number. As you have it now you’re generating one random number, then incrementing it and printing it out 20 times so you’re going to get 20 sequential numbers. Try something like srand(time(NULL)); // Seeding the random number generator for(int i=0; i<20; ++i) { cout … Read more

[Solved] Generate random string from list of string in C#? [closed]

Try this: class Program { static void Main(string[] args) { int myRandomIndex = 0; var myList = new List<string>(new[] { “a”, “b”, “c”, “d”, “e”, “f”, “g”, “h”, “i”, “j” }); var results = new List<string>(); var r = new Random(DateTime.Now.Millisecond); for (int ii = 0; ii < 4; ii++) { myRandomIndex = r.Next(myList.Count); results.Add(myList[myRandomIndex]); … Read more