From: anw@maths.nott.ac.uk (Dr A. N. Walker)
Subject: Re: How to calculate the Date of Easter?
Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker)
Organization: Maths Dept., Nott'm Univ., UK.
Date: Fri, 9 Oct 1992 17:56:11 GMT

In article <1992Oct8.154757.21053@panix.com> fnord@panix.com
(Cliff Heller) writes:
>I believe Easter is defined as the first Sunday after the first full moon
>after the first day of spring.

	Yes, but it's not the *real* full moon, but an ecclesiastical version.
There is a program for this, with comments and learned references, in
"informal introduction to ALGOL 68" by c. h. lindsey and s. g. van der meulen
(north-holland), 1971 or 1977 [rev ed].  "My" version of this program,
lightly edited and comments stripped from L&vdM's version follows.  Easily
converted into C, Perl, anything reasonable.  As it's not exactly shell,
purists can 'k'ill here.

-- 
Andy Walker, Maths Dept., Nott'm Univ., UK.
anw@maths.nott.ac.uk

Script started on Fri Oct  9 18:45:05 1992
$ a68s easter.8
easter.8
$ a.out
1992

Easter for 1992 (leap year).
The Dominical Letter is E/D.
The Golden Number is 17, and the Epact is 25.
The Paschal Full Moon falls upon Friday April 17.
Easter day, being the next Sunday after the Paschal Full Moon,
therefore falls upon April 19.

$ cat easter.8
.if .loc .int year, date, moon, paschal, easter;
    .int gregory start = 1752;
    .proc conv = (.int n) .string: (" " + whole (n, 0));
     read (year);
     year <= gregory start
  .then print (("Sorry, the Gregorian calendar wasn't introduced until",
                conv (gregory start), ".", newline))
  .else .bool leap = year %* 4 = 0 .and year %* 100 /= 0 .or year %* 400 = 0;
        .int feb = 28 + .abs leap, cent = year % 100;
        .int march21st = 31 + feb + 21;
         print ((newline, "Easter for", conv (year),
                 (leap | " (leap year)." | "."), newline));
        .int dom = 7 - (year + year%4 - cent + cent%4 - 1 - .abs leap) %* 7;
         print (("The Dominical Letter is ", "ABCDEFG"[dom],
                 (leap | "/" + "ABCDEFG"[(dom-2) %* 7 + 1] + "." | "." ),
                 newline));
        .proc weekday = (.int date) .string:
           (((date - dom) %* 7 | "Mon", "Tues", "Wednes", "Thurs", "Fri",
                   "Satur" | "Sun") + "day");
        .proc month = (.ref .int date) .string: # only March/April needed! #
           ((date -:= 31 + feb) <= 31 | "March" | date -:= 31; "April");
        .int golden = year %* 19 + 1,
             lilius = (cent - cent%4 - (cent-(cent-17)%25)%3 - 8) %* 30;
        .int epact = (11 * (golden-1) - lilius) %* 30;
        .if moon := 31 - epact + 59 + .abs leap;
            (paschal := moon + 13) < march21st
          .then .int clavius = (golden > 11 | 26 | 25);
                 moon +:= (epact > clavius | 30 | 29);
                 paschal := moon + 13
        .fi;
         print (("The Golden Number is", conv (golden), ", and the Epact is",
                 conv (epact), ".", newline));
         print ("The Paschal Full Moon falls upon " + weekday (paschal) +
                 " " + month (date := paschal));
         print (conv (date));
         print ((".", newline, "Easter day, being the next Sunday after the "
                 "Paschal Full Moon,", newline, "therefore falls upon ",
                 month (date := easter := paschal + 7 - (paschal-dom)%*7)));
         print ((conv (date), ".", newline))
.fi
$ 
script done on Fri Oct  9 18:45:28 1992
Newsgroups: comp.unix.shell