You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Seeds the pseudorandom number generator to the value of# <i>number</i>. If <i>number</i> is omitted,# seeds the generator using a combination of the time, the# process id, and a sequence number. (This is also the behavior if# <code>Kernel::rand</code> is called without previously calling# <code>srand</code>, but without the sequence.) By setting the seed# to a known value, scripts can be made deterministic during testing, and# even in different applications sequence of generated randoms numbers # are the same. The previous seed value is returned.# Also see <code>Kernel::rand</code>.## srand(2011)# rand(100) #=> 43# rand(100) #=> 77# rand(100) #=> 40## srand(2011)# rand(100) #=> 43# rand(100) #=> 77# rand(100) #=> 40
The text was updated successfully, but these errors were encountered:
I'm already working on stuff in the Array class and will also improve some of the method description like for example the different ways of initializing an Array.
Just wanted to let you know so that we don't duplicate efforts.
I only add some examples of using that method, and I don't include more description or other ways of how to instantiate an object of Array class, so it will be fine.
I will go through some methods that I understand and add/update more examples on those methods.
Ex:
Improve on Array() method's example:
Improve on srand() method:
The text was updated successfully, but these errors were encountered: