Thanks Rick -

But the part that confuses me is:

while (year1.to_i <= year2.to_i)

Shouldn't that prevent 1992 from being printed?

Also - re: yeap year being divisible by 100 - I do plan on adding that 
in after I get past this hump. Thanks for the input.


Rick Denatale wrote:
> On Fri, Oct 1, 2010 at 2:05 PM, Mica Koizumi <monkeymica / yahoo.com> 
> wrote:
>> if year1.to_i % 4 == 0
>> ?leapyear = year1.to_i + 4
>> ?puts leapyear
>> end
> 
> This says 'paraphrasing"
> 
> if year1 is a leapyear then print year1 + 4
> 
> 1988 is the only leap year between 1987 and 1990.
> 
> 1988 + 4 is 1992
> 
> 
> BTW, it's not enough for a year to be divisible by 4 to be a leap year.
> 
> Years divisible by 100 are not leap years (even though they are all
> divisible by 4) unless they are also divisible by 400.
> 
> --
> Rick DeNatale
> 
> Blog: http://talklikeaduck.denhaven2.com/
> Github: http://github.com/rubyredrick
> Twitter: @RickDeNatale
> WWR: http://www.workingwithrails.com/person/9021-rick-denatale
> LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
Posted via http://www.ruby-forum.com/.