From: Hal Fulton Date: 2004-03-20T07:12:51+09:00 Subject: Re: Thinking about a date-matching algorithm... Joel VanderWerf wrote: > Joel VanderWerf wrote: > > Goofed on that last bit: > >> tenth_day = proc {|d| d[/Julian day: (\d+)/, 1] % 10 == >> Date.new(2004,1,8).jd % 10} >> >> puts "It's a multiple of ten days since 8 Jan 2004" if tenth_day > > > > tenth_day = proc { |d| > d[/Julian day: (\d+)/, 1].to_i % 10 == Date.new(2004,1,8).jd % 10 > } > > puts "It's a multiple of ten days since 8 Jan 2004" if tenth_day[coords] > > > The complete output is: > > "day-ordinal-month: 4, 3, 3; day-month: 18, 3; day-week: 4, 12; day of > year: 78; Julian day: 2453083; year: 2004" > It's Thursday again. > It's the 1st or 3rd Thursday again. > It's a multiple of ten days since 8 Jan 2004 Joel, This technique is pretty clever, but it is a different shape from my brain. Hal