REM  PROGRAM  easter.bas
REM PROGRAM TO COMPUTE THE EASTER DATE FOR A GIVEN YEAR
REM AFTER 1582.
REM BASED ON THE ALGORITHM BY THE NEOPOLITAN ASTRONOMER -
REM  ALOYSIUS LILIUS AND THE GERMAN JESUIT MATHEMATICIAN -
REM  CHRISTOPHER CLAVIUS OF LATE 16TH CENTURY.
CORRECT = 0
WHILE NOT CORRECT
   INPUT "Enter the Year :", Y
   IF Y < 1582 THEN
      PRINT "Year has to be after 1582"
   ELSEIF Y <> INT(Y) THEN
      PRINT "Year Has to be an integer"
   ELSE
      CORRECT = -1
   END IF
WEND
G = Y MOD 19 + 1   'GOLDEN NUMBER OF THE YEAR
C = Y \ 100 + 1    'CENTURY NUMBER
X = 3 * C \ 4 - 12
Z = (8 * C + 5) \ 25 - 5
D = 5 * Y \ 4 - X - 10
E = (11 * G + 20 + Z - X) MOD 30  'FIND EPACT
IF E < 0 THEN E = E + 30          'FIND POSITIVE REMAINDER
IF (E = 25 AND G > 11) OR (E = 24) THEN E = E + 1
N = 44 - E    'FIND CALENDAR FULL MOON
IF N < 21 THEN N = N + 30
' ADVANCE TO SUNDAY
N = N + 7 - ((D + N) MOD 7)
IF N > 31 THEN
   PRINT USING "Easter Date = ## APRIL ####"; (N - 31); Y
ELSE
   PRINT USING "Easter Date = ## MARCH ####"; N ; Y
END IF
END
