0

I have a requirement to produce a quiz and I need to randomize all numbers but only once between 0 and 24 (25 questions).

For example:

Next 'Question Button' is pressed and it will iterate randomly all 25 numbers until all numbers are used only once. Once it gets to the 25th number, it should go to the 'submit for results' on a last page. I am using C# Multiview to produce the quiz wizard pages but don't quite know how to achieve this efficiently.

So far, I have something like this to generate the numbers, but I don't know the best way to both generate a number and remember that number as the person goes through each page of the quiz to the final number:

 Random rnd = new Random();

        Console.WriteLine("\n25 random integers from 0 to 24:");
        for (int ctr = 1; ctr <= 25; ctr++)
        {
            Console.Write("{0,6}", rnd.Next(0, 24));
            if (ctr % 5 == 0) Console.WriteLine();
        }
Jason
  • 652
  • 8
  • 23

0 Answers0