hi how can i generate random odd integers? i want it to refer to user.id thanks -- Posted via http://www.ruby-forum.com/.
Am 09.07.2009 um 13:20 schrieb Ghazal Mir:> how can i generate random odd integers?Something like: 2 * rand(6) + 1 ? The example will give you an odd number between 1 and 11 (both included). Adapt the number in rand as needed. More details here http://ruby-doc.org/core/classes/Kernel.html#M005974 As a side note: Google is your friend. Felix