DuskNotes
|
  |
| Joined: 29 Dec 2013 |
| Total Posts: 1337 |
|
| |
|
| |
|
|
| 29 Jan 2014 09:46 AM |
*Wrong forum section.
BTW: Scripting Helpers. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 01:06 PM |
i personally thnk the best way to do probability is like,
if math.random() <= 0.1 then --10% chance, math.random doesnt go below 0.1 often
you can even go 0.005. smallest i've ever seen math.random get is 0.0000741 |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 01:17 PM |
| It can get 0. That's the lowest. It cannot reach 1. |
|
|
| Report Abuse |
|
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 29 Jan 2014 01:59 PM |
it acn get negative numbers 2 u no u kno, negative numbers? that r below 0? yes, them |
|
|
| Report Abuse |
|
|
| |
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
| |
|
| |
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 29 Jan 2014 02:13 PM |
| why dont u test it urself? it can return negative numbers, why wouldnt it be able to. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 02:15 PM |
| Because math.random() generates a random integer greater than or equal to 0, but less than 1. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 02:18 PM |
^ integer...?
EOS db 0x00 ;End of String Marker |
|
|
| Report Abuse |
|
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 29 Jan 2014 02:20 PM |
@kitkat, whats the highly technical term for it then mister assemblymaster
@unkno, thats what u say, and its not true. k |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 02:30 PM |
| @AndroidKitKat: Brain melt. Ignore that word. I never typed it (I didn't! D:) |
|
|
| Report Abuse |
|
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 29 Jan 2014 02:31 PM |
| oh no u lost so much street cred ppl wont think ur that intelligent and smart anymor. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 03:15 PM |
From the Lua 5.1 reference:
"math.random ([m [, n]])
...
When called without arguments, returns a uniform pseudo-random real number in the range [0,1)."
You just lost all u street kred kid OoHHHhHhhh WHAT A LOSER oOhHhHhhHHh |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 03:18 PM |
| i probably have twice the street cred that all of you have. even more maby . |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2014 03:27 PM |
HOW TO DO A 10% CHANCE!!!
times = 0 for I = 1, 100 do--percent if math.random(1, 100) > 50 then times = times + 1 end end if times <= 10 then --drop bow end |
|
|
| Report Abuse |
|
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 30 Jan 2014 07:50 AM |
| show-off, get out if ur not gonna do anything else other than bragging |
|
|
| Report Abuse |
|
|
MettaurSp
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
|
| 30 Jan 2014 04:39 PM |
if math.floor(tick() * 100)%10==1 then print("probability of 10% based on time o3o") end |
|
|
| Report Abuse |
|
|
B00M3RT0M
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 162 |
|
|
| 31 Jan 2014 03:00 PM |
| well lookie here, trollbait is showing off once again. |
|
|
| Report Abuse |
|
|
MettaurSp
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
| |
|
|
| 31 Jan 2014 05:19 PM |
@MettaurSp:
But still, why not (math.random() < 0.1)? |
|
|
| Report Abuse |
|
|
MettaurSp
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
|
| 31 Jan 2014 05:21 PM |
| Cause I was aiming for a method that doesn't use that out of boredom o3o |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2014 05:26 PM |
(tick()*1) < 0.1
But that feels less random :< |
|
|
| Report Abuse |
|
|