If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Ruby Random
3 posts
• Page 1 of 1
Ruby Random
Have replaced a green random set up using simply
=rand(100) or =rand(0..100)
Seems to work great, but i don't know how ruby is actually "doing it"
My question is..should i build it like the green set up that I use now,
that gets a new seed based on the current time???
...will "new.seed" make it better, or time displacement???
or is ruby already doing these things to a certain extent with just =rand(100) or =rand(0..100) ???
so maybe just leave it as it is???
Proper random was a interesting issue back at SM....
....has anyone already gone down this path in Ruby....?
=rand(100) or =rand(0..100)
Seems to work great, but i don't know how ruby is actually "doing it"
My question is..should i build it like the green set up that I use now,
that gets a new seed based on the current time???
...will "new.seed" make it better, or time displacement???
or is ruby already doing these things to a certain extent with just =rand(100) or =rand(0..100) ???
so maybe just leave it as it is???
Proper random was a interesting issue back at SM....
....has anyone already gone down this path in Ruby....?
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Ruby Random
Hi billy,
From the Ruby API docs, it looks that the seeding is handled automatically - a time/process ID based seed is created on the first call unless you use the 'srand' call to set one explicitly.
From the Ruby API docs, it looks that the seeding is handled automatically - a time/process ID based seed is created on the first call unless you use the 'srand' call to set one explicitly.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Ruby Random
trogluddite wrote:seeding is handled automatically - a time/process ID based seed is created on the first call
So no need to use this 'new.seed' thing to add variation, or mess with the time like we did in SM.
trogluddite wrote:unless you use the 'srand' call to set one explicitly.
and we have the power to customize it.
Wow...well thought out...
Destroys the old random issue in one hit.....
thanks Trog
...Ruby claims another victim.....my SM parts slowly diss-appearing....
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 81 guests