Post Reply 
Back on Forum
03-09-2016, 09:14 PM (This post was last modified: 03-09-2016 09:15 PM by Dieter.)
Post: #14
RE: Back on Forum
(03-06-2016 12:43 PM)ggauny@live.fr Wrote:  I submit, as present, you a little routine that it is from Joe Horn and a friend of He which optmized. It is "friday the 13" in any year in gregorian.

I think I now understand how your program is supposed to work. It returns all Friday 13 dates on the stack so that they can be viewed with R↓ or SHOW.

However, since up to three dates per year can occur and at least two stack levels are required for the calculation, setting SSIZE8 is mandatory. Also the program has to run through all 12 months and not just 11.

Here is a version that should come close to what you had in mind:

Code:
LBL A
STO 00
D.MY
SSIZE8
CLSTK
RCL 00
#012
STO 00
#013
→DATE
LBL 01
RCL X
WDAY
#005
-
x≠0?
SKIP 003
DROP
ENTER
ENTER
DROP
#001
SDR 002
-
DSZ 00
GTO 01
DROP
END

Example:
2012 [A] returns all three Friday 13 dates on the stack:

13.072012
13.042012
13.012012

If you prefer the m.dy date format, simply set line 3 accordingly and omit the SDR 002 command near the end of the program.

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


Messages In This Thread
Back on Forum - ggauny@live.fr - 03-06-2016, 12:43 PM
RE: Back on Forum - Didier Lachieze - 03-06-2016, 02:31 PM
RE: Back on Forum - d b - 03-06-2016, 03:27 PM
RE: Back on Forum - Sylvain Cote - 03-06-2016, 03:46 PM
RE: Back on Forum - Dieter - 03-06-2016, 07:10 PM
RE: Back on Forum - Dwight Sturrock - 03-06-2016, 07:18 PM
RE: Back on Forum - Jlouis - 03-06-2016, 07:40 PM
RE: Back on Forum - rprosperi - 03-06-2016, 09:33 PM
RE: Back on Forum - Etienne Victoria - 03-06-2016, 09:37 PM
RE: Back on Forum - ggauny@live.fr - 03-07-2016, 09:20 AM
RE: Back on Forum - ggauny@live.fr - 03-07-2016, 12:02 PM
RE: Back on Forum - Dieter - 03-07-2016, 12:57 PM
RE: Back on Forum - Thomas Radtke - 03-07-2016, 12:05 PM
RE: Back on Forum - Dieter - 03-09-2016 09:14 PM
RE: Back on Forum - Dieter - 03-12-2016, 12:30 PM



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