Jump to content
Sign in to follow this  
XCess

Random Question

Recommended Posts

Just a lil question. How can you randomly select a number between a range starting at a negative number and ending at a positive. For example: between -100 and +100.

I know random 100 would select a number between 0 and 100 but how do you start the range below 0?

I know this is possible because I made an artillery script about three years ago using a negative to positive selection range.

**edit**

I think i've got it:

random(100)-100

but I'm not a hundred percent sure. Could someone clarify it for me? Thanks in advance wink_o.gif

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(random 200)-100

Will get you anumber between -100 and 100

Share this post


Link to post
Share on other sites

Thanks Sanctuary. Guess I should solve this.  smile_o.gif

hmm, don't see a solve button or anything of the sort. I miss ofpec!! crazy_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]

random(100)-100

_a = - (random(100))

wink_o.gif

that would be always negative..

Sanctuary is right wink_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×