I'm getting some very strange behavior, please help!
I'm iterating through an object array, the participate property is a bool. The method randomly assigns each person a true or false (50/50 right now). As the code is right now, all five people either get all true or all false. When the message box is enabled, the code works properly (each person gets a true or false, not all the same)!!!!
for (int i = 0; i < 5; i++)
{
//other code removed, I'll add it if it turns out to be important to the problem
person[i].participate = doesPersonJoin();
}
public bool doesPersonJoin()
{
bool joinBool = true;
Random rnd = new Random();
int r = rnd.Next(1, 100);
//MessageBox.Show(r.ToString());
if (r > 50)
{
joinBool = false;
}
return joinBool;
}