Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

##APL 132##

APL 132

This algorithm calculates the number of days Easter lies relative to the beginning of March. The date is returned in the YYYYMMDD format as allowed in the question:

E y 
(a b)←⌊((3 ×ばつ⌊y÷100)+ ̄5 13)÷4 25 
c←7|y+(⌊y÷4)-a-e←⌊d-((×ばつd←30|(227-(×ばつc)-a-b))+c←19|y)÷543
+/(10*4 2 0)×ばつy,(3+i>31),(61⍴⍳31)[i←e+28-c] 

Taking the original test cases:

 E 2013
20130331
 E 1583
15830410
 E 3029
30290322
 E 1789
17890412 

##APL 132##

This algorithm calculates the number of days Easter lies relative to the beginning of March. The date is returned in the YYYYMMDD format as allowed in the question:

E y 
(a b)←⌊((3 ×ばつ⌊y÷100)+ ̄5 13)÷4 25 
c←7|y+(⌊y÷4)-a-e←⌊d-((×ばつd←30|(227-(×ばつc)-a-b))+c←19|y)÷543
+/(10*4 2 0)×ばつy,(3+i>31),(61⍴⍳31)[i←e+28-c] 

Taking the original test cases:

 E 2013
20130331
 E 1583
15830410
 E 3029
30290322
 E 1789
17890412 

APL 132

This algorithm calculates the number of days Easter lies relative to the beginning of March. The date is returned in the YYYYMMDD format as allowed in the question:

E y 
(a b)←⌊((3 ×ばつ⌊y÷100)+ ̄5 13)÷4 25 
c←7|y+(⌊y÷4)-a-e←⌊d-((×ばつd←30|(227-(×ばつc)-a-b))+c←19|y)÷543
+/(10*4 2 0)×ばつy,(3+i>31),(61⍴⍳31)[i←e+28-c] 

Taking the original test cases:

 E 2013
20130331
 E 1583
15830410
 E 3029
30290322
 E 1789
17890412 
Source Link
Graham
  • 7.8k
  • 1
  • 15
  • 13

##APL 132##

This algorithm calculates the number of days Easter lies relative to the beginning of March. The date is returned in the YYYYMMDD format as allowed in the question:

E y 
(a b)←⌊((3 ×ばつ⌊y÷100)+ ̄5 13)÷4 25 
c←7|y+(⌊y÷4)-a-e←⌊d-((×ばつd←30|(227-(×ばつc)-a-b))+c←19|y)÷543
+/(10*4 2 0)×ばつy,(3+i>31),(61⍴⍳31)[i←e+28-c] 

Taking the original test cases:

 E 2013
20130331
 E 1583
15830410
 E 3029
30290322
 E 1789
17890412 

AltStyle によって変換されたページ (->オリジナル) /