Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
FROST Blade
20
Years of Service
User Offline
Joined: 2nd Oct 2004
Location:
Posted: 4th Jan 2005 10:17
Is there a way to choose a random number out of a group of number say 3,34,334,62,6245,134,245 yeah anyway is there a way to choose a random number out of that group of numbers??????????
FROST Blade
20
Years of Service
User Offline
Joined: 2nd Oct 2004
Location:
Posted: 4th Jan 2005 10:23
HELLO?!?!?!?!?!?!
Neofish
21
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Jan 2005 10:26 Edited at: 4th Jan 2005 10:50
you could make it so with something like this:



That's tested so it works, if you extend the function params and other stuff you can have more results to randomly choose from.

Hope that helps

EDIT: Patience is a virtue
EDIT: Edited to add for each loop

Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 4th Jan 2005 10:44
Another way...

Neofish
21
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Jan 2005 10:46
Personally mine looks easier, but otherwise there isn't much difference

Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 4th Jan 2005 10:56 Edited at: 4th Jan 2005 10:56
But with yours, the more numbers to add the messier is gets, whereas, apart from setting the values in mine, the code is almost unchanged. You could use a Data statement to list the group...

Neofish
21
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Jan 2005 11:40
Pah, spose your right

Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 4th Jan 2005 12:23
Obviously it's down the your preferred way of working, but personally I wouldn't like an add an extra parameter to my function, plus the accompanying Case statement everytime I increase the size of my group. Also my way is a bit more convenient, say you had a group of numbers of differing size, your way is not as practical. When using arrays you can resize to the required size and fill it up, and the way my function is coded means it can handle an array of any size.
FROST Blade
20
Years of Service
User Offline
Joined: 2nd Oct 2004
Location:
Posted: 5th Jan 2005 07:19
Thanks guys this really helps

Login to post a reply

Server time is: 2025-06-09 03:54:11
Your offset time is: 2025-06-09 03:54:11