Results 1 to 4 of 4

Thread: RANDOMING FUNCTION EASY PLEASE HELP

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    I know you can randomize by putting a = (rnd * 5) but that is form 0 - 5 is there a way to pick random number out of a bunch of numbers? for instance. pick a random number out of 1,50,100,63,78,1000 so it will randomly pick one of those numbers. Thanks!!

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    just have fun out there and live life to the fullest while it is still here
    Email [email protected]


  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    put the numbers into an array an let the random function pick the numbers out of it!
    ok, it's rather complicated but it works.

    number = numberarray(Int(Rnd() * numbercount))

    ------------------
    Razzle
    ICQ#: 31429438

  3. #3

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    I don't quite get it could you give me an example please?

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    just have fun out there and live life to the fullest while it is still here
    Email [email protected]


  4. #4
    Guest

    Post

    numberarray(0) = 1
    numberarray(1) = 50
    numberarray(2) = 100...etc
    numberarray(3) = 63
    numberarray(4) = 78
    mynumber = numberarray(int(rnd * 4))

Posting Permissions

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



Click Here to Expand Forum to Full Width