📜  红宝石 |随机 new_seed()函数

📅  最后修改于: 2022-05-13 01:55:39.566000             🧑  作者: Mango

红宝石 |随机 new_seed()函数

Random#new_seed() : new_seed()是一个 Random 类方法,它返回一个随机种子值。

示例 #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