On May 9, 2007, at 8:40 AM, Tracy Harms wrote:
calendar =: 3 : 0
a=. ((j<100)*(-100&|){.6!:0'')+j=. {.
b=. a+-/<.4 100 400%~<:a
r=. 28+3,(~:/0=4 100 400|a),10$5$3 2
r=. ,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42
m=. m,(0=#m=. <:}.y)#i.
h=. 'JanFebMarAprMayJunJulAugSepOctNovDec'
h=. ' Su Mo Tu We Th Fr Sa',:"1~_3(_12&{.)\h
<"2 m{h,"2[12 6 21$,>(<'') ((r=0)#i.#r)} <"1 [ 3":,.r
)
By the way, I would like to identify the author of the
verb defined above, because I'd like to give proper
credit when I refer to it in the future. I am in the
process of creating a "guided tour" through the
definition of this verb, which I'll post on the web
when completed.
I think Chris Burke is responsible for it. You can find it at: j601/
system / main/ dates.ijs
calendar=: 3 : 0
a=. ((j<100)*(-100&|){.6!:0'')+j=. {.y
b=. a+-/<.4 100 400%~<:a
r=. 28+3,(~:/0=4 100 400|a),10$5$3 2
r=. ,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42
m=. m,(0=#m=. <:}.y)#i.12
h=. 'JanFebMarAprMayJunJulAugSepOctNovDec'
h=. ' Su Mo Tu We Th Fr Sa',:"1~_3(_12&{.)\h
<"2 m{h,"2[12 6 21$,>(<'') ((r=0)#i.#r)} <"1 [ 3":,.r
)
APL Quote Quad 10.1, September 1979, has my huge one-liner calendar
function, that has three auxiliary functions.
There's also my article on calendars APL Quote Quad 7.4 Winter 1977,
the one that Jeff Shallit had in mind when he wrote his point paper
with Erdos.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm