generate 6 digit random number ruby
10.times.map{rand(10)}.join # => "3401487670"
generate 6 digit random number ruby
10.times.map{rand(10)}.join # => "3401487670"
random number rails
Use rand(range)
From Ruby Random Numbers:
If you needed a random integer to simulate a roll of a six-sided die, you'd use: 1 + rand(6). A roll in craps could be simulated with 2 + rand(6) + rand(6).
Finally, if you just need a random float, just call rand with no arguments.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us