2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,35 +1,34 @@
|
|||
/*REXX program converts a mm/dd/yyyy Gregorian date ───► Discordian date. */
|
||||
@day.1= 'Sweetness' /*define the 1st day─of─Discordian─week*/
|
||||
@day.2= 'Boomtime' /* " " 2nd " " " " */
|
||||
@day.3= 'Pungenday' /* " " 3rd " " " " */
|
||||
@day.4= 'Prickle-Prickle' /* " " 4th " " " " */
|
||||
@day.5= 'Setting Orange' /* " " 5th " " " " */
|
||||
/*REXX program converts a mm/dd/yyyy Gregorian date ───► a Discordian date. */
|
||||
@day.1= 'Sweetness' /*define the 1st day─of─Discordian─week*/
|
||||
@day.2= 'Boomtime' /* " " 2nd " " " " */
|
||||
@day.3= 'Pungenday' /* " " 3rd " " " " */
|
||||
@day.4= 'Prickle-Prickle' /* " " 4th " " " " */
|
||||
@day.5= 'Setting Orange' /* " " 5th " " " " */
|
||||
|
||||
@seas.0= "St. Tib's day," /*define the leap─day of Discordian yr.*/
|
||||
@seas.1= 'Chaos' /* " 1st season─of─Discordian─year.*/
|
||||
@seas.2= 'Discord' /* " 2nd " " " " */
|
||||
@seas.3= 'Confusion' /* " 3rd " " " " */
|
||||
@seas.4= 'Bureaucracy' /* " 4th " " " " */
|
||||
@seas.5= 'The Aftermath' /* " 5th " " " " */
|
||||
@seas.0= "St. Tib's day," /*define the leap─day of Discordian yr.*/
|
||||
@seas.1= 'Chaos' /* " 1st season─of─Discordian─year.*/
|
||||
@seas.2= 'Discord' /* " 2nd " " " " */
|
||||
@seas.3= 'Confusion' /* " 3rd " " " " */
|
||||
@seas.4= 'Bureaucracy' /* " 4th " " " " */
|
||||
@seas.5= 'The Aftermath' /* " 5th " " " " */
|
||||
|
||||
parse arg gM '/' gD "/" gY . /*get the specified Gregorian date*/
|
||||
if gM=='' | gM=='*' then parse value date('U') with gM '/' gD "/" gY .
|
||||
parse arg gM '/' gD "/" gY . /*obtain the specified Gregorian date. */
|
||||
if gM=='' | gM=='*' then parse value date('U') with gM '/' gD "/" gY .
|
||||
|
||||
gY=left(right(date(),4),4-length(Gy))gY /*adjust for 2─digit year or none.*/
|
||||
gY=left( right( date(), 4), 4 - length(Gy) )gY /*adjust for two─digit year or none. */
|
||||
|
||||
/* [↓] day─of─year, leapyear adj.*/
|
||||
doy=date('d',gY || right(gM,2,0)right(gD,2,0), "s") - (leapyear(gY) & gM>2)
|
||||
/* [↓] day─of─year, leapyear adjust. */
|
||||
doy=date('d', gY || right(gM, 2, 0)right(gD ,2, 0), "s") - (leapyear(gY) & gM>2)
|
||||
|
||||
dW=doy//5; if dW==0 then dW=5 /*compute the Discordian weekday. */
|
||||
dS=(doy-1)%73+1 /* " " " season. */
|
||||
dD=doy//73; if dD==0 then dD=73 /*compute Discordian day─of─month.*/
|
||||
dD=dD',' /*append a comma to Discordian day*/
|
||||
if leapyear(gY) & gM=2 & gD=29 then ds=0 /*is this St. Tib's day (leapday)?*/
|
||||
if ds==0 then dD= /*adjust for Discordian leap day. */
|
||||
dW=doy//5; if dW==0 then dW=5 /*compute the Discordian weekday. */
|
||||
dS=(doy-1)%73+1 /* " " " season. */
|
||||
dD=doy//73; if dD==0 then dD=73 /* " " " day─of─month. */
|
||||
if leapyear(gY) & gM=2 & gD=29 then ds=0 /*is this St. Tib's day (leapday) ? */
|
||||
if ds==0 then dD= /*adjust for the Discordian leap day. */
|
||||
|
||||
say space(@day.dW',' @seas.dS dD gY+1166) /*display the Discordian date. */
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*────────────────────────────────────────────────────────────────────────────*/
|
||||
leapyear: procedure; parse arg y /*obtain four-digit Gregorian year*/
|
||||
if y//4\==0 then return 0 /*Not ÷ by 4? Not a leapyear.*/
|
||||
return y//100\==0 | y//400==0 /*apply the 100 and 400 year rule.*/
|
||||
say space(@day.dW',' @seas.dS dD"," gY +1166) /*display Discordian date to terminal. */
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
leapyear: procedure; parse arg y /*obtain a four─digit Gregorian year. */
|
||||
if y//4\==0 then return 0 /*Not ÷ by 4? Then not a leapyear. */
|
||||
return y//100\==0 | y//400==0 /*apply the 100 and 400 year rules.*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue