

Task

Convert a given date from the   Gregorian calendar   to the   Discordian calendar.




          R   DISCORDIAN DATE CALCULATION
          R
          R   PUNCH CARD SHOULD CONTAIN -
          R   MM/DD/YYYY
          R   IN GREGORIAN CALENDAR 
 
            NORMAL MODE IS INTEGER
 
            VECTOR VALUES MLENGT = 
          0   0,0,31,59,90,120,151,181,212,243,273,304,334
            VECTOR VALUES TIBS = 
          0   $31HSAINT TIBS DAY IN THE Y.O.L.D. ,I4*$
            VECTOR VALUES DISDAT = 
          0   $C,6H, DAY ,I2,S1,3HOF ,C,S1,16HIN THE Y.O.L.D. ,I4*$
 
            VECTOR VALUES DISDAY = $SWEETMORN$, $BOOMTIME$,
          0   $PUNGENDAY$, $PRICKLE-PRICKLE$, $SETTING ORANGE$
            VECTOR VALUES DISSSN = $CHAOS$, $DISCORD$,
          0   $CONFUSION$, $BUREAUCRACY$, $THE AFTERMATH$
 
            VECTOR VALUES CLDAY  = $10HCELEBRATE ,C,3HDAY*$
            VECTOR VALUES CLFLUX = $10HCELEBRATE ,C,4HFLUX*$
            VECTOR VALUES HOLY5  = $MUNG$,$MOJO$,$SYA$,$ZARA$,$MALA$
            VECTOR VALUES HOLY50 = $CHAO$,$DISCO$,$CONFU$,$BURE$,$AF$
 
            READ FORMAT GREG,GMONTH,GDAY,GYEAR
            VECTOR VALUES GREG = $2(I2,1H/),I4*$
 
            WHENEVER GMONTH.E.2 .AND. GDAY.E.29
                PRINT FORMAT TIBS, GYEAR + 1166
            OTHERWISE
                YRDAY = MLENGT(GMONTH)+GDAY
                SEASON = YRDAY/73
                DAY = YRDAY-SEASON*73
                WKDAY = (YRDAY-1)-(YRDAY-1)/5*5
                PRINT FORMAT DISDAT, DISDAY(WKDAY), DAY,
          0         DISSSN(SEASON), GYEAR + 1166
                WHENEVER DAY.E.5
                    PRINT FORMAT CLDAY, HOLY5(SEASON)
                OR WHENEVER DAY.E.50
                    PRINT FORMAT CLFLUX, HOLY50(SEASON)
                END OF CONDITIONAL 
            END OF CONDITIONAL          
            END OF PROGRAM