The player that has the letter that is closest to “A” will begin the game. A blank tile will win the start of the game
The easiest way to do this, although not the most efficient, is to have two for or foreach loops. Each foreach loop would cycle though a players hand with a check to see if the ascii value of the letter is less then the best (which would be stored in a variable for each player), if it is the that is the best. After both players have the best values, they would be compared and whichever is lower will have their turn played first.
int P1BestScore = int.MaxValue;
int P2BestScore = int.MaxValue;
bool PlayerOnePlayedFirst = false;
while (/*Normal Information*/)
{
foreach (char Letter in PlayerOneTiles)
{
if ((int)Letter < P1BestScore)
{
P1BestScore = (int)Letter;
}
}
foreach (char Letter in PlayerTwoTiles)
{
if ((int)Letter < P2BestScore)
{
P2BestScore = (int)Letter;
}
}
if (PlayerOnePlayedFirst)
{
HaveTurn(/* Player one data */ );
}
else
{
HaveTurn(/* Player two data */);
}
// . . .
if (PlayerOnePlayedFirst)
{
HaveTurn(/* Player two data */);
}
else
{
HaveTurn(/* Player one data */);
}
}
// . . .
}