From: Alex Untitled Date: 2009-11-15T12:03:26+09:00 Subject: Re: How do I get a random number between two random numbers? Marnen Laibow-Koser wrote: > Alex Untitled wrote: >> I want to create a program that asks you to guess a number between two >> numbers. The problem is that I can't figure out how to make the numbers >> that you're guessing between random and have the random number you are >> guessing between those two numbers. Does anybody know how to do this? > > Well, you know how to generate the first two random numbers, right? > Just take the difference between those two as the range in which to > generate the third. Simple. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen@marnen.org So, would it be something like this? num1 = rand(101) num2 = rand(101) num3 = num1 + num2 Anyway, thank you! -- Posted via http://www.ruby-forum.com/.