Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smokemotes
#5
Thumbs Up 
(01-19-2023, 02:43 AM)James D Jarvis Wrote:
(01-19-2023, 02:27 AM)bplus Wrote: To be more interesting try having smoke follow mouse and drifting up.

This kind of thing is kinda goofy:
Code: (Select All)
var = Int(Rnd * 3) - Int(Rnd * 3)


if you want a random single at 10 +/- 5  
r = 10 + rnd*10 -5

for integers at 100 +/- 10
Code: (Select All)
For i = 1 To 100
    r = 100 + Int(21 * Rnd) - 10 ' because INT() rounds down, int(Rnd * 1 more than max range) minus 1/2 range
    Print r,
Next

It's not even remotely goofy. I didn't do that because I want the bell curve created by the two calls to rnd to make the median result more likely than the extremes. What you are showing here would create a linear distribution within the range which I didn't want.

+1 OK not seen that before, works great!
Code: (Select All)
Dim As Long a(-11 To 11)
For i = 1 To 100000
    r = Int(Rnd * 11) - Int(Rnd * 11)
    a(r) = a(r) + 1
Next
For i = -11 To 11
    Print String$(Int(a(i) / 1000), "*")
Next
b = b + ...
Reply


Messages In This Thread
Smokemotes - by James D Jarvis - 01-18-2023, 10:16 PM
RE: Smokemotes - by James D Jarvis - 01-18-2023, 11:47 PM
RE: Smokemotes - by bplus - 01-19-2023, 02:27 AM
RE: Smokemotes - by James D Jarvis - 01-19-2023, 02:43 AM
RE: Smokemotes - by bplus - 01-19-2023, 04:15 AM
RE: Smokemotes - by James D Jarvis - 01-19-2023, 03:16 PM
RE: Smokemotes - by bplus - 01-19-2023, 06:11 PM
RE: Smokemotes - by RokCoder - 01-19-2023, 01:01 PM
RE: Smokemotes - by James D Jarvis - 01-19-2023, 03:03 PM
RE: Smokemotes - by James D Jarvis - 01-19-2023, 07:14 PM



Users browsing this thread: 2 Guest(s)