Ruby | Random new() function
Last Updated :
17 Dec, 2019
Random#new() : new() is a Random class method which creates a new PRNG using seed to set the initial state.
Syntax: Random.new()
Parameter: Random values
Return: a new PRNG using seed to set the initial state.
Example #1 :
date_a = Random. new ()
puts "Random new form : #{date_a}\n\n"
|
Output :
Random new form : #
Example #2 :
date_b = Random. new ()
puts "Random new form : #{date_b}\n\n"
|
Output :
Random new form : #
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...