I'm having trouble with something that should seem so simple. I'm using a conditional and on a pretest loop While and it doesn't seem to even execute one because the conditions are met but they're not.
I have but the loop never seems be met/ when I break on it. It just skips over it
int sorter = random.Next(0, 10);
bool player1full = false;
bool player2full = false;
while (player1full && player2full == false)
{
if (chuckcards[sorter] != null)
{
while (player1full != true)
{
if (player1.Count != 5)
{
player1.Enqueue(chuckcards[sorter]);
chuckcards[sorter] = null;
}
else
{
player1full = true;
}
sorter = random.Next(0, 10);
}
while (player2full != true)
{
if (chuckcards[sorter] != null)
{
if (player2.Count != 5)
{
player2.Enqueue(chuckcards[sorter]);
chuckcards[sorter] = null;
}
else
{
player2full = true;
}
sorter = random.Next(0, 10);
}
}
}
else
{
sorter = random.Next(0, 10);
}
}
My logic maybe slightly off and I'm just wanting someone to point me in the right direction/see my error.
Thank you