Get the date of Easter from the year.

' * Algoritm submitted by Agamemnus.
' * Testing shows that this works 100% for 1600-9999.
defint a-z
INPUT year

a = year MOD 19
b = year \ 100
c = year MOD 100
d = b \ 4
e = b MOD 4
f = (b + 8) \ 25
g = (b - f + 1) \ 3
h = ((19 * a) + b - d - g + 15) MOD 30
i = c \ 4
j = c MOD 4
k = (32 + 2 * e + 2 * i - h - j) MOD 7
l = (a + 11 * h + 22 * k) \ 451
m = (h + k - 7 * l + 114)
n = m \ 31 ' Month of Easter.
o = m MOD 31 + 1 ' Day of Easter.

' **************************************************************

' * Algoritm submitted by Antoni Gual.
' * Testing shows that this works 100% for 1600-9999.
defint a-z
INPUT year
J = year MOD 19
K = year \ 100
L = year MOD 100
M = K \ 4
N = K MOD 4
O = L \ 4
P = L MOD 4
Q = (8 * K + 13) \ 25
R = (19 * J + K - M - Q + 15) MOD 30
S = (J + 11 * R) \ 319
T = (2 * (N + O) - P - R + S + 32) MOD 7
U = R - S + T

Month = (U + 90) \ 25 ' Month of Easter.
Day = (U + Month + 19) MOD 32 ' Day of Easter.

' **************************************************************

' * Butcher algorithm submitted by WhiteTiger(?).
' * Testing shows that this works 100% for 1600-9999.
defint a-z
INPUT year
a = year MOD 19
b = INT(year / 100)
c = year MOD 100
d = INT(b / 4)
e = b MOD 4
f = INT((b + 8) / 25)
g = INT((b - f + 1) / 3)
h = ((19 * a) + b - d - g + 15) MOD 30
i = INT(c / 4)
j = c MOD 4
k = (32 + (2 * e) + (2 * i) - h - j) MOD 7
l = INT((a + (11 * h) + (22 * k)) / 451)
m = INT((h + k - (7 * l) + 114) / 31) 'Month of Easter.
n = 1 + ((h + k - (7 * l) + 114) MOD 31) 'Day of Easter.

' **************************************************************

' Oudin algorithm (1940) submitted by Moneo.
' Testing shows that this works 100% for 1600-9999.
defint a-z
INPUT year
century = year\100
G = year MOD 19
K = (century - 17)\25
I = (century - century\4 - (century - K)\3 + 19*G + 15) MOD 30
I = I - (I\28)*(1 - (I\28)*(29\(I + 1))*((21 - G)\11))
J = (year + year\4 + I + 2 - century + century\4) MOD 7
L = I - J
EMM = 3 + (L + 40)\44 ' Month of Easter.
EDD = L + 28 - 31*(EMM\4) ' Day of Easter.

EasterDate - page last edited 2006-10-31 22:21:03 by 24.128.143.175 (home) (edit)
Blast WIKI - by RoboticBoy - edited and tweaked for our evil purposes by Hexadecimal Disaster