Back on Forum
|
03-06-2016, 12:43 PM
Post: #1
|
|||
|
|||
Back on Forum
Hello for all of you,
I am happy to be back with you all. I was in deasease. 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. [/code] LBL'FRI' LBL'A' // Because it is more queeker 6 10^x // it is ALOG / 13.12 + #011 STO 00 DROP ENTER ENTER 4.043 DELTADAYS 7 MOD x=0? SF00 DROP FS?C00 ENTER ENTER 0.01 - DSE 00 BACK 022 DROP END[/code] [code] This give all fridays the 13 in a year. I thank people they have asked me. I don't forget JEBEM Gérard. |
|||
03-06-2016, 02:31 PM
Post: #2
|
|||
|
|||
RE: Back on Forum
Welcome back Gérard !
We were a bit worried about your absence. I hope your OK now, and that you have recovered from your sickness. |
|||
03-06-2016, 03:27 PM
Post: #3
|
|||
|
|||
RE: Back on Forum
Yes. Welcome back Gérard.
|
|||
03-06-2016, 03:46 PM
Post: #4
|
|||
|
|||
RE: Back on Forum
Bonjour Gérard,
Heureux de vous revoir sur le site. J'espère que vous êtes complètement rétablis. Sylvain |
|||
03-06-2016, 07:10 PM
Post: #5
|
|||
|
|||
RE: Back on Forum
(03-06-2016 12:43 PM)ggauny@live.fr Wrote: I am happy to be back with you all. I was in deasease. Ah, welcome back then. :-) (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. Thank you very much. Here is a version that works in any date mode (d.my, m.dy or y.md). It returns all dates where the 13th is a Friday, starting at the year entered in X. One data register is required – here I chose the I-register. Code: LBL A Example: Code: 2010 [A] => 13.08.2010 But somehow I do not like this trial-and-error approach. I would prefer a more analytic algorithm: determine the day of week for 13 January, calculate the next Friday 13th from this, finally add a certain number of days for the next one. But this would get much more complicated than the current method. ;-) Dieter |
|||
03-06-2016, 07:18 PM
Post: #6
|
|||
|
|||
RE: Back on Forum
Great to have you back! Glad to hear you are feeling better.
|
|||
03-06-2016, 07:40 PM
Post: #7
|
|||
|
|||
RE: Back on Forum
Good news, you're better and back!
Cheers! |
|||
03-06-2016, 09:33 PM
Post: #8
|
|||
|
|||
RE: Back on Forum
(03-06-2016 12:43 PM)ggauny@live.fr Wrote: Hello for all of you, Welcome back Gérard, glad you are feeling better; good to see you come back with a contribution. Your enthusiasm and smile were missed. --Bob Prosperi |
|||
03-06-2016, 09:37 PM
Post: #9
|
|||
|
|||
RE: Back on Forum
Bonjour Gérard,
Heureux de vous revoir parmi nous ! A bientôt ! Amicalement Etienne |
|||
03-07-2016, 09:20 AM
Post: #10
|
|||
|
|||
RE: Back on Forum
Hi,
Many thanks for good wishes from you all ! It is a great pleasure for me for your concern of me. Thanks. Gérard. |
|||
03-07-2016, 12:02 PM
Post: #11
|
|||
|
|||
RE: Back on Forum
Dear Dieter,
I well recognize you because always a better solution of routine ! Because you said in the past that it is better use not LBL and GTO, but BACK, I have tryed Back 023 in replacing GTO 01, and of course I Ruber the LBL01. It run. I know it is possible to do the algorithm you say but I don't know how. Good day. Gérard. |
|||
03-07-2016, 12:05 PM
Post: #12
|
|||
|
|||
RE: Back on Forum
Welcome back, hope you've completely recovered!
|
|||
03-07-2016, 12:57 PM
Post: #13
|
|||
|
|||
RE: Back on Forum
(03-07-2016 12:02 PM)ggauny@live.fr Wrote: Because you said in the past that it is better use not LBL and GTO, but BACK, Well, it's not better, but faster and it saves a label. But in this case I simply was too lazy to count or calculate the number of steps for the BACK command. ;-) (03-07-2016 12:02 PM)ggauny@live.fr Wrote: I have tryed Back 023 in replacing GTO 01, and of course I Ruber the LBL01. It run. Yes, of course it should. (03-07-2016 12:02 PM)ggauny@live.fr Wrote: I know it is possible to do the algorithm you say but I don't know how. So do I (at the moment ;-)). The Prime program in your attachment uses a similar method in that it calculates the next Friday 13th from the weekday of Jan 13. As far as I know newer versions of the Prime contain date-related commands (correct me if I'm wrong here), so it should be possible to get a more compact program. Dieter |
|||
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 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 |
|||
03-12-2016, 12:30 PM
Post: #15
|
|||
|
|||
RE: Back on Forum
(03-09-2016 09:14 PM)Dieter Wrote: Here is a version that should come close to what you had in mind: And finally here are two versions that will work both with 4 and 8 stack levels. Here the fifth level was saved by checking if the 9th of a month is a Monday. This version uses the d.my date format: Code: LBL A And here is a version for users in the m.dy region. It does not even require a data register. Code: LBL B Example: 2012 [A] returns all three Friday 13 dates on the stack: 13.072012 13.042012 13.012012 2012 [B] does the same in m.dy format: 7.132012 4.132012 1.132012 Instead of a year also a date within that year can be entered, e.g. it doesn't matter if you enter 2012 or 04.052012. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)