Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smokemotes
#9
Thumbs Up 
(01-19-2023, 03:16 PM)James D Jarvis Wrote:
(01-19-2023, 04:15 AM)bplus Wrote: +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

You beat me to the code that demonstrates a bell curve at work.  You shouldn't ever get -11 or 11 with that code however (unless rnd bumps a bit over at some point). 
You can alter the distribution on the curve by changing the range of elements used.

These would all produce a score of 2 to 20 but have different looking result curves:
Code: (Select All)
r1 = Int(1 + Rnd * 10) + (1 + Rnd * 10)
r2 = Int(1 + Rnd * 12) + (1 + Rnd * 8)
r3 = Int(1 + Rnd * 8) + Int(1 + Rnd * 8) + Int(Rnd * 5)


run enough times and r1 is the most pronounced curve with most results coming in the middle.
r2 will have a flatter curve than r1 with  a wider range of likely results with a collapsing chance of getting the rarer results (2,3,19,and20) , and r3 should be flatter than that.

Thanks for this the first one I demo'd has been something I've sort of been wanting for long time.

Now I see the dust smoke mote connection, also might be good for sun and stars?

These new ones I will definitely check out.

+1 between this and Rotozoom you deserve at least another point from me. Two beauties in one night!
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: 3 Guest(s)