Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    6

    Unanswered: Display sequence of numbers in random order

    Does anyone know of an elegant way to take a series of numbers and display them in a random order where each number is displayed only once?

    I suppose I could generate a random number and check to see if it has been displayed already but that seems clunky and there's no way to predict how long it would take to display the whole series.

    I had also thought about adding all 20 numbers to an array, picking a random position in the array and displaying it, then removing that position from the array and picking a random position from the remaining 19 and so on until I've displayed all 20 numbers.

    Any suggestions?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    The second option sounds better but you have to keep redimensioning your array which can be a pain in the arse.

    Do you display them all at once or do you display one on each page hit??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •