[Solved] How do you populate two Lists with one text file based on an attribute? [closed]

By the suggestions in the comments, partialy @Charles_May ‘s: Simply looping: List<string> Source = {}; //source list List<string> Females = new List<string>(), Males = new List<string>(); foreach (string value in Source) { if (value.ToUpper().Contains(“,F,”)) //Female { Females.Add(value); } else { Males.Add(value); } }//result: both lists are with values That’s it. if you’s like to make … Read more

[Solved] My C code for a genetic algortihtm is not functioning, it dosent enter into the if condition

The problem in your program comes from the subject selection (after adding the missing }): s=random_number_creator(5,0); Will return a random number between 0 and 4 included. To correct this, just replace this line by s=random_number_creator(7,0); To pick a number between 0 and 6. So the cou variable will be able to reach 0 Your code … Read more