From: James Edward Gray II Date: 2005-12-08T05:51:24+09:00 Subject: Re: Newer to Ruby On Dec 7, 2005, at 2:47 PM, Kwhamec Rojas wrote: > Hi. I am new to Ruby and new to programming altogether, but I am > really > trying to learn as fast as I can. > > So here's my problem: I need to be able to generate a random nine > digit > number. The first number cannot be 9,8 or 7. > > I am using Watir to test a site, but I will need to randomly generate > this number or the test will be rejected. Thank you very much for > whatever help you can give me. See if this gives you some ideas: >> digits = [rand(7)] + Array.new(8) { rand(10) } => [5, 6, 1, 2, 5, 4, 7, 1, 1] James Edward Gray II