DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦f786ec889⟧ TextFile

    Length: 2304 (0x900)
    Types: TextFile
    Names: »EASTER.PAS«

Derivation

└─⟦49cd49952⟧ Bits:30009431 50004848
    └─⟦0c326962c⟧ 
        └─⟦this⟧ »EASTER.PAS« 

TextFile

PROGRAM easter;

CONST   fyr = 1976;  lyr = 2000;
TYPE    yr  = 1583..4200;
        mn  = (march,april);
        dy  = 1..31;
VAR     year: yr;  month: mn;  day: dy;

PROCEDURE dateofeaster(y: yr;  VAR d: dy;  VAR m: mn);

       æThis procedure calculates the date of Easter in year y,
        and returns the day d and month m.  The algorithm is
        taken from Knuth's "Fumdamental Algorithms", where in
        turn there is acknowledgement to the Neapolitan Aloysius
        Lillius and the German Jesuit mathematician Christopher
        Clavius.  It applies for any year from 1582 to 4200.å

  VAR   gold: 1..19;      æthe "golden number"å
        cent: 16..43;     æcenturyå
        epact: -29..30;   æthe "epact" specifies full moonå
        sun:  1950..3750; æMarch (-sun)MOD 7 is a Sundayå
        full: 14..55;     ædate of full moonå
        x:    2..11;      æcorrection for years divisible by 4
                           but not leap years, e.g. 1900å
        z:    1..10;      æsynchronisation with moon's orbitå

  BEGIN
    gold := y MOD 19 + 1;
    cent := y DIV 100 +1;
    x := 3 * cent DIV 4 - 12;
    Z := (8 * cent + 5) DIV 25 - 5;
    sun := 5 * y DIV 4 - x - 10;
    epact := (11 * gold + 20 + Z - X) MOD 30;
    IF epact < 0 THEN epact := epact + 30;
    IF (epact = 25) AND (gold > 11) OR
       (epact = 24) THEN epact := epact + 1;
    full := 44 - epact;
    IF full < 21 THEN full := full + 30;
                          æEaster is the "first Sunday following
                           the first full moon which occurs on
                           or after March 21st".å
    full := full + 7 - (sun + full) MOD 7;
    IF full > 31 THEN
      BEGIN  m := april;
        d := full - 31;
      END
    ELSE
      BEGIN  m := march;
        d := full;
      END;
    END  ædateofeasterå;

  BEGIN  æprogramå
    page(output);  writeln('Dates of Easter:');  writeln;
    FOR year := fyr TO lyr DO
      BEGIN
        dateofeaster(year,day,month);
        write(year:4);
        IF month = march THEN write('March':7) ELSE write('April':7);
        writeln(day:4);
      END;
  END.
«eof»