lundi 14 mai 2018

How to prevent duplication in c# [duplicate]

This question already has an answer here:

I want each question to be displayed only once. Can someone help! :)

    {
        List<string> question = new List<string>();

        question.Add("Question number 1");
        question.Add("Question number 2");
        question.Add("Question number 3");
        question.Add("Question number 4");

        Random Rand = new Random();

        for (int i = 0; i < 4; i++)
        {

            int index = Rand.Next(0, 4);
            displayQuestion.Text = question[index]; 
        }




Aucun commentaire:

Enregistrer un commentaire