1. ALToronto's Avatar
    There are lots of random number generators in App World, but what I need is different. Say you have a regular sequence of numbers, from 1 to N. Re-arranging them in random order is the equivalent of writing each number, from 1 to N, on a piece of paper, throwing the pieces of paper in a box and pulling them out one by one. I don't need anything fancy in terms of UI or customization (it's always from 1 to whatever), just something that works. Even Excel doesn't do this.

    Anybody up for a challenge? TIA
    04-30-12 03:45 PM
  2. FF22's Avatar
    04-30-12 07:03 PM
  3. kdna's Avatar
    There are lots of random number generators in App World, but what I need is different. Say you have a regular sequence of numbers, from 1 to N. Re-arranging them in random order is the equivalent of writing each number, from 1 to N, on a piece of paper, throwing the pieces of paper in a box and pulling them out one by one. I don't need anything fancy in terms of UI or customization (it's always from 1 to whatever), just something that works. Even Excel doesn't do this.

    Anybody up for a challenge? TIA
    I would like to try this. I'll keep you posted on what I come up with.
    ALToronto likes this.
    05-01-12 03:10 AM
  4. GinaWrite's Avatar
    You can do this in BASIC for PlayBook

    constant N 50
    array numbers N

    for a = 1 to N
    numbers(a) = a
    next a

    for a = 1 to N
    b = integer(random(N)) + 1
    t = numbers(b)
    numbers(b) = numbers(a)
    numbers(a) = t
    next a

    ' the array numbers now contains the numbers 1 to N shuffled randomly

    for a = 1 toi N
    print numbers(a)
    next a
    ALToronto likes this.
    05-01-12 05:19 AM
  5. polytope's Avatar
    You can do this in BASIC for PlayBook
    BASIC for PlayBook? Wow. Nice. Downloading.

    Now someone should port Haskell to PlayBook. That'd be cool.
    05-01-12 05:34 AM
LINK TO POST COPIED TO CLIPBOARD