Post Reply 
(12C Platinum) Day of Easter
09-17-2016, 07:12 PM (This post was last modified: 09-17-2016 09:28 PM by Dieter.)
Post: #19
RE: (12C Platinum) Day of Easter
(09-15-2016 01:15 AM)Gerson W. Barbosa Wrote:  Unfortunately my HP-42S program gets Easter of 1954 wrong (Apr-25 instead of Apr-18). Hopefully not my fault as this agrees with the original Basic program:

Gerson, I just happened to find this algorithm via Google books in a Turbo Pascal book by Nell Dale and Chip Weems. There is a remark saying that the program works for years between 1982 and 2048 (!). And within the period from 1900 to 2099 there are four years where the result is one week late: 1954 (sic!), 1981, 2049 and 2076. ;-)

If you still have the magazine article you mentioned, you may look if there is a similar remark with this restriction.

Update: Here is a 42s version of the Easter/Carnival program based on the 29C algorithm.
The method for determining the number of days in February is explained at this 35s program.

Code:
 00 { 216-Byte Prgm }
 01>LBL "EASTER"
 02 ABS
 03 IP
 04 STO 01
 05 19
 06 MOD
 07 STO 00
 08 11
 09 STO× 00
 10 ÷
 11 STO 02
 12 44
 13 STO+ 00
 14 1
 15 RCL 01
 16 %
 17 IP
 18 +
 19 32
 20 %
 21 0.2
 22 +
 23 IP
 24 STO+ 00
 25 Rv
 26 75
 27 %
 28 IP
 29 STO 03
 30 STO- 00
 31 RCL 02
 32 RCL 00
 33 30
 34 MOD
 35 X>Y?
 36 GTO 00
 37 1
 38 +
 39>LBL 00
 40 STO 04
 41 +/-
 42 RCL 01
 43 0.8
 44 ÷
 45 IP
 46 +
 47 RCL 03
 48 -
 49 3
 50 STO 03
 51 +
 52 7
 53 MOD
 54 +/-
 55 RCL 04
 56 -
 57 57
 58 +
 59 STO 04
 60 31
 61 "Easter:   "        ; three blanks after colon
 62 XEQ 01
 63 STO 02
 64 29
 65 RCL 01
 66 4
 67 MOD
 68 X!=0?
 69 SIGN
 70 RCL 01
 71 100
 72 MOD
 73 X!=0?
 74 SIGN
 75 +
 76 RCL 01
 77 400
 78 MOD
 79 X!=0?
 80 SIGN
 81 +
 82 2
 83 STO 03
 84 MOD
 85 -
 86 RCL 04
 87 49                  ; Carnival is 49 days before Easter
 88 -
 89 X<>Y
 90 +
 91 STO 04
 92 LASTX
 93 |-"\LFCarnival: "   ; first character is linefeed
 94 XEQ 01
 95 RCL 02
 96 X<>Y
 97 AVIEW
 98 ADV
 99 RTN
100>LBL 01
101 RCL 04
102 X<=Y?
103 GTO 02
104 X<>Y
105 -
106 ISG 03
107>LBL 02
108 9
109 X<>Y
110 X<=Y?
111 |-" "
112 AIP
113 RCL 03
114 +/-
115 AIP
116 RCL 01
117 +/-
118 AIP
119 1E4
120 ÷
121 +
122 100
123 ÷
124 -
125 END

Example:

1954   XEQ "EASTER"
=>
Easter:   18-4-1954
Carnival: 28-2-1954

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C Platinum) Day of Easter - Dieter - 09-14-2016, 10:36 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-15-2016, 01:15 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-15-2016, 08:42 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-17-2016 07:12 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-14-2016, 01:20 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-14-2016, 08:40 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-16-2016, 06:03 AM
RE: (12C Platinum) Day of Easter - Dieter - 09-15-2016, 05:46 PM
RE: (12C Platinum) Day of Easter - Dieter - 09-16-2016, 06:14 AM



User(s) browsing this thread: 1 Guest(s)