From: brabuhr@... Date: 2010-08-18T21:23:54+09:00 Subject: Re: can i do this in ruby? a simulation process On Wed, Aug 18, 2010 at 6:58 AM, Bruce Wayner wrote: > sorry I'm totally suck in ruby here is my code: Don't worry about it so much, we all start as beginners :) >> A vehicle leaves the first city every 5-35sec. >  $depart = rand(35) This will give you: 0 <= $depart < 35 but, you want: 5 <= $depart <= 35 >> It takes 50sec-1min &10sec for vehicles to travel >  $travelTime = rand(70) Similarly, this gives you: 0 <= $travelTime < 70 but, you want: 50 <= $travelTime <= 70 As a sidenote, in Ruby you don't need "$" on all your variables (only for global variables, which you generally don't need): http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Variables_and_Constants That's all the further I've been able to look at your code for now.