Quote:
Originally Posted by Mitch
Code:
void setSongOptions()
{
MediaPlayer.Pause();
//Chose correct song and play it
int random = RandomHelper.GetRandomInt(4);
int randomSongIndex = RandomHelper.GetRandomInt(songCount);
correctSong = mediaLibrary.Songs[randomSongIndex];
//Fill list
for (int count = 0; count < 4; count++)
{
randSongTitle = mediaLibrary.Songs[RandomHelper.GetRandomInt(songCount)].Name;
while (randSongTitle == correctSong.Name)
randSongTitle = mediaLibrary.Songs[RandomHelper.GetRandomInt(songCount)].Name;
songTitles[count] = randSongTitle;
}
songTitles[random] = mediaLibrary.Songs[randomSongIndex].Name;
MediaPlayer.Resume();
MediaPlayer.Play(correctSong);
correctAnswer = random;
//roundTime = new TimeSpan();
loadedSongs = true;
}
this should fix the chance of the same song showing up twice in the list of choices. just put this in where his setSongOption block is.
|
Kk, I'll try it out.
Edit: Error: The Name 'randsongtitle' does not exist in the current context