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
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 15th May 2004 03:56
Is there a Probility proc like 20% chances and stuff 50% etc..

A 1 man team
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th May 2004 04:18
probability what?

"eureka" - Archimedes
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 15th May 2004 04:59
like chance in stuff like if 20% else type thing so its probability

A 1 man team
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 15th May 2004 05:52 Edited at: 15th May 2004 05:54
if you mean executing commands randomly, then try this:

that will sometimes print hello or bye, both with a 1/5 chance.

or just chance:
guess a number between 1 and 100


rnd(100) will return a number between 0 and 100, so it will be a 1% chance that your number is on the screen. Hope that helps

.........what's the point of reading this?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th May 2004 13:25
Actually, random numbers range from 0 to the number that you tell it, so to get a 1 in 5 you need to check 'RND(4)' (0,1,2,3,4) and check for a single number.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 18th May 2004 09:53
Damn, forgot about that. In that case, I'd go: rnd(4)+1, To give a number between 1 and 5, with the actual 5 included, so I dont get confused later.

.........what's the point of reading this?

Login to post a reply

Server time is: 2024-09-22 09:34:49
Your offset time is: 2024-09-22 09:34:49