Calculate any Easter Date

Developer(s): Daniel B. Nickell
Date: 1987
Type: Program
Platform(s): TS 2068
Tags: Calendar

Works out the date of Easter Sunday for a year you type in, using the Gregorian calendar method (the year modulo 19, 100, 4 and so on, step by step as the article lists them) and prints it as, for example, EASTER SUNDAY, 1987, falls on APRIL 19. It then offers another year (press y). The modulo is a user-defined function, FN M(X,Y).

From the book Forecasting On Your Microcomputer by Daniel B. Nickell (TAB Books), adapted to Sinclair BASIC by the article’s author. As printed, the modulo function lost a fraction in the TS2068’s arithmetic and many years came out a day or a week wrong (2000 gave April 22 instead of April 23); the download rounds it in line 30. The method is for the Gregorian calendar, from 1583.

Published in The Plotter November 1987 (Calculate any Easter Date).

Image Gallery

Source Code

  10 PRINT "PROGRAM TO CALCULATE EASTER FOR ANY YEAR": PRINT
  20 DIM M$(5,8): LET M$(2)="FEBRUARY": LET M$(3)="MARCH": LET M$(4)="APRIL": LET M$(5)="MAY"
  30 DEF FN M(X,Y)=INT (Y*(X/Y-INT (X/Y))+.5)
  35 REM this can be read as M(X,Y) is the same as X mod Y.
  40 INPUT "Enter year (4 digits) ";Y
  50 LET A=FN M(Y,19)
  60 LET B=INT (Y/100): LET C=FN M(Y,100)
  70 LET D=INT (B/4): LET E=FN M(B,4)
  80 LET F=INT ((B+8)/25): LET G=INT ((B-F+1)/3)
  90 LET H=FN M((19*A)+B-D-G+15,30)
 100 LET I=INT (C/4): LET K=FN M(C,4)
 110 LET L=FN M(32+(2*E)+(2*I)-H-K,7)
 120 LET M=INT ((A+(11*H)+(22*L))/451)
 130 LET Z=H+L-(7*M)+114: LET N=INT (Z/31): LET P=FN M((H+L-(7*M)+114),31)
 140 PRINT "EASTER SUNDAY, ";Y;", falls on    ";M$(N);INT (P+1)
 160 PAUSE 200: CLS : PRINT "Another year? y or n ": PAUSE 200: IF INKEY$="y" OR INKEY$="Y" THEN  CLS : GO TO 20

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.