I am trying to grab one item from each of the lists here and combine them to create a unique name. It's just for the bumps. :)
Here is the list:
List<string> FirstNames = new List<string>() { "Sergio", "Daniel", "Carolina", "David", "Reina", "Saul", "Bernard", "Danny", "Dimas", "Yuri", "Ivan", "Laura" }; List<string> LastNamesA = new List<string>() { "Tapia", "Gutierrez", "Rueda", "Galviz", "Yuli", "Rivera", "Mamami", "Saucedo", "Dominguez", "Escobar", "Martin", "Crespo" }; List<string> LastNamesB = new List<string>() { "Johnson", "Williams", "Jones", "Brown", "David", "Miller", "Wilson", "Anderson", "Thomas", "Jackson", "White", "Robinson" };
I know that I get one item through the index, and also know that I can use the Random class to generate a random number from 0 to ListFoo.Count.
What I don't know is to check if a random permutation from the collections has already been set out.
I was thinking about using the tuple class:
List<Tuple<int,int,int>> permutations = new List<Tuple<int,int,int>>();
But I have a brainstorming here .;) Any directions? I'm really not looking for all the code for this simple problem, just a suggestion or a hint.
EDIT
Thanks to the suggestions given here, this is what I came up with. Any room for improvements?
static void Main(string[] args) { List<string> FirstNames = new List<string>() { "Sergio", "Daniel", "Carolina", "David", "Reina", "Saul", "Bernard", "Danny", "Dimas", "Yuri", "Ivan", "Laura" }; List<string> LastNamesA = new List<string>() { "Tapia", "Gutierrez", "Rueda", "Galviz", "Yuli", "Rivera", "Mamami", "Saucedo", "Dominguez", "Escobar", "Martin", "Crespo" }; List<string> LastNamesB = new List<string>() { "Johnson", "Williams", "Jones", "Brown", "David", "Miller", "Wilson", "Anderson", "Thomas", "Jackson", "White", "Robinson" }; var permutations = new List<Tuple<int, int, int>>(); List<string> generatedNames = new List<string>(); Random random = new Random(); int a, b, c;