Home News Feeds DZone Create a random number in Ruby
Sep 08
Wednesday
Create a random number in Ruby PDF Print E-mail
Friday, 19 March 2010 13:48
Return a value from 0 to 5:
rand(6)

Return a value between 0 and 1:
rand

Resources:
- Module: Kernel [ruby-doc.org]

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/aIaVxWHYbAE/10611

 
Home News Feeds DZone Create a random number in Ruby