easter←{                    ⍝ Easter Sunday in year ⍵.
    G←1+19|⍵                ⍝ year "golden number" in 19-year Metonic cycle.
    C←1+⌊⍵÷100              ⍝ Century: for example 1984 → 20th century.

    X←¯12+⌊C×3÷4            ⍝ number of years in which leap year omitted.
    Z←¯5+⌊(5+8×C)÷25        ⍝ synchronises Easter with moon's orbit.

    S((5×⍵)÷4)-X+10       ⍝ find Sunday.
    E←30|(11×G)+20+Z-X      ⍝ Epact.
    FE+(E=24)(E=25)G>11  ⍝   (when full moon occurs).

    N(30×F>23)+44-F        ⍝ find full moon.
    NN+7-7|S+N             ⍝ advance to Sunday.

    M←3+N>31                ⍝ month: March or April.
    DN-31×N>31             ⍝ day within month.
    ↑10000 100 1+.×⍵ M D    ⍝ yyyymmdd.
}
code_colours

test script

Back to: notes

Back to: Workspaces