Post Reply 
(12C Platinum) Day of Easter
09-15-2016, 01:15 PM (This post was last modified: 09-15-2016 05:36 PM by Dieter.)
Post: #10
RE: (12C Platinum) Day of Easter
(09-15-2016 01:15 AM)Gerson W. Barbosa Wrote:  Very nice! I will try it when I find my 3-cell 12C.

You can also implement that algorithm on the 42s.
This avoids the error you got with the program you linked to:

(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:

Yes, the error is "by design" – obviously the calculation gets something wrong.

I tried the BASIC algorithm in another 42s implementation and it gets the same errors. But in a much shorter program and with merely two data registers:

Code:
00 { 123-Byte Prgm }
01>LBL "EASTER"
02 ABS
03 IP
04 STO 00
05 19
06 MOD
07 STO 01
08 RCL 00
09 4
10 MOD
11 STO+ ST X
12 RCL 00
13 7
14 MOD
15 4
16 ×
17 +
18 19
19 RCL× 01
20 24
21 +
22 30
23 MOD
24 STO 01
25 6
26 ×
27 +
28 5
29 +
30 7
31 MOD
32 RCL+ 01
33 22
34 +
35 ENTER
36 ENTER
37 31
38 MOD
39 X=0?
40 X<> ST L
41 "Easter: "
42 9
43 X>=Y?
44 |-" "
45 Rv
46 AIP
47 X<>Y
48 32
49 ÷
50 IP
51 3
52 +
53 +/-
54 AIP
55 RCL 00
56 +/-
57 AIP
58 1E4
59 ÷
60 +
61 100
62 ÷
63 -
64 FIX 06
65 AVIEW
66 END

Edit: replaced program with an updated version, including a bugfix.

OK, this is without the carnival part. ;-) But Free42 features additional calendar functions, so a simple –49 DATE+ at the end will get you the date of carnival.

But once again: there is an error in this algorithm.
The mentioned 29C program seems to work fine. So what about a 42s version?

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)