Ruby Random new_seed()函数
Random#new_seed() : new_seed() 是一个随机类的方法,用于返回一个随机种子值。
语法。随机.new_seed()
参数。随机值
返回:一个随机的种子值
例子 #1 :
# Ruby code for Random.new_seed() method
# declaring Random value
date_a = Random.new_seed()
# new arbitrary random value
puts "Random new_seed form : #{date_a}\n\n"
输出:
Random new_seed form : 136900168362527727761982174954109934532
例子 #2 :
# Ruby code for Random.new_seed() method
# declaring Random value
date_b = Random.new_seed()
# new arbitrary random value
puts "Random new_seed form : #{date_b}\n\n"
输出:
Random new_seed form : 271255499858368204233299869842415724010