mercredi 25 avril 2018

Checking if two strings are the same, if they are, need to redo loop

firstRound = (i + "&" + partnerOne);
secondRound = (i + "&" + partnerTwo);

while (firstRound.Equals(secondRound))
{
    myCount = myCount + 1;
    spotTwo = rnd.Next(heelerEntries.Count);
    partnerTwo = heelerEntriesTwo[spotTwo];
    secondRound = (i + "&" + partnerTwo);
    if (myCount == 5)
    {
        MessageBox.Show("Messed up 5 times!");
        break;
    }

As seen in the code above, i am trying to see if the strings firstRound and secondRound are the same. If they are, i want it to redo the entire second round loop. The code is for randomizing teams from a list so i cannot have the same team for the different rounds. If anyone is able to help, or give me other ideas on ways to do this, i appreciate it.




Aucun commentaire:

Enregistrer un commentaire