Since you wondered why so many people were using todayno, I can answer that.
Here is a challenge I posted.  I'm working to find questions that might
interest elementary school children as they learn to use J.  I was
suggesting this as a challenge for discussion for the end of 6th grade.

I posted a challeng on 9 20 2014 called: [Jprogramming] Weekend Puzzle - Age
of Groundhog born 2002 2 2  This is a copy of the message I sent out.

Using the verb  todayno  which provides the number of days since the
beginning of 1800,  write what you need to find the age today of a groundhog
born on 2002 2 2. 

    todayno 2014 9 2014
80418

   2014 9 20 age 2002 2 2
12 7 18

 His age is 12 years, 7 months and 18 days.  Use simple J.  Check that your
solution provides a correct answer for you birthday.

 Have a pleasant weekend.
 

At least it seemed to encourage a long winded conversation as the thread has
had 49 responses since then. I realized that I should start in 1901 and then
hit a snag in the correct answer for 2000.  In any case, it was far more
enlightening than I ever suspected.

It certainly was not intended the puzzle be a definitive and extensive
factual history of the calendar.  I had never realized how domplex the
problem was and I learned alot along the way.  I am sure that some teacher
who takes the question seriously would find all your information most
helpful to answer questions that might arise. It might even connect to
history the students may be studying,

Thanks for all the facts you have mentioned.

Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of 'Leslie S
Satenstein' via Beta
Sent: Sunday, September 28, 2014 12:26 AM
To: [email protected]
Subject: Re: [Jbeta] Concern about todayno

leapyear = ((year mod 400) =0 ) or ((year mod 4 = 0) and not ((year mod
100)= 0).
[Jprogramming] Weekend Puzzle - Age of Groundhog born 2002 2 2It seems to me
to be excessive use of todayno.  Not having seen the code to todayno, I
would 

presume it uses a gregorian to Julian day number conversion,    The julian
day is defined as 

(jan 1 year 1)  = zero  

and todayno calculates the days since.

I would presume that the correction includes the 10 day jump in year 1580
where the Pope corrected the gregorian calendar by declaring the new
leapyear rule and ....   October 21 1580 was deemed to be Nov 1st of that
year.

Furthermore, if you want to know what day of the week the the 31th of the
month is, you would realize that it would be 3 days after February 28, for
non leap years and three days after Feb 29th on leapyears.   A similar rule
applies for months with 30 days.
This was an established convention.  

   

 
Regards


 Leslie





>________________________________
> From: robert therriault <[email protected]>
>To: Beta forum <[email protected]> 
>Sent: Wednesday, September 24, 2014 10:28 AM
>Subject: Re: [Jbeta] Concern about todayno
> 
>
>Hi Henry,
>
>...and because it doesn't exist Feb 29, 2003 has the same todayno value as
March 1, 2003. That seems pretty reasonable to me since checking if  2003 2
29 =&todayno  2003 3 1 becomes a way (albeit heavy handed) to discern leap
years.
>
>Cheers, bob 
>
>On Sep 24, 2014, at 2:14 AM, Henry Rich <[email protected]> wrote:
>
>> 2003 2 29 doesn't exist
>> 
>> Henry Rich
>> 
>> On 9/24/2014 5:13 AM, Linda Alvord wrote:
>>>  Shouldn't the difference be 366 every four years.  Bob's comments
caused me
>>> to worry about leap year, and I am getting incorrect answers but they
may be
>>> based on this.
>>> 
>>> 
>>> 
>>> diff=: 13 :'(todayno x)-todayno y'
>>> 
>>> 
>>> 
>>>        (2005 3 1) diff 2004 2 29
>>> 
>>> 366
>>> 
>>>       (2004 3 1) diff 2003 2 29
>>> 
>>> 366
>>> 
>>>       (2003 3 1) diff 2002 2 29
>>> 
>>> 365
>>> 
>>>       (2002 3 1) diff 2001 2 29
>>> 
>>> 365
>>> 
>>>       (2001 3 1) diff 2000 2 29
>>> 
>>> 366
>>> 
>>>       (2000 3 1) diff 1999 2 29
>>> 
>>> 366
>>> 
>>>       (1999 3 1) diff 1998 2 29
>>> 
>>> 365
>>> 
>>>       (1998 3 1) diff 1997 2 29
>>> 
>>> 365
>>> 
>>>       (1997 3 1) diff 1996 2 29
>>> 
>>> 366
>>> 
>>>       (1996 3 1) diff 1995 2 29
>>> 
>>> 366
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
>
>>> 
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>----------------------------------------------------------------------
>For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to