The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Fridays the 13th, ported to Prime
01-14-2015, 09:04 PM
Post: #1
Fridays the 13th, ported to Prime
Hi,
I've tryed port to Prime an jewel from Master Horn, Friday the 13 (see "one minute marvels" page 14), for superstitious!!! Normally i am allowed but i don't know.
Certainely it is possible do better because i am bad with PPL. Well you need 2 routines to do the job.
Code:
EXPORT Vend13(AN)
BEGIN
LOCAL A,B,C,G,L;
L:={};
B:=(AN/1000000)+13.01;

//13.011987▶B;
13.063▶C;

FOR A FROM 1 TO 13 DO
13.063;
DDAYSS(C,B)▶R;
IF NOT(R MOD7)
THEN B▶L(A);END;
IF A<14 THEN B:=B+0.01;
 
END;

END;
PRINT(L);
END;

EXPORT DDAYSS(D1,D2)
BEGIN
LOCAL a1,m1,j1,a2,m2,j2,z1,z2;
D1:=FP((D1)*100)*10000+IP(FP(D1)*100)
/100+IP(D1)/10000;
D2:=FP((D2)*100)*10000+IP(FP(D2)*100)
/100+IP(D2)/10000;
//YYYY.MMDD
a1:=IP(D1);//YYYY
m1:=IP(FP(D1)*100);//MM
j1:=IP(FP(FP(D1)*100)*100);//DD
//YYYY.MMDD(2)
a2:=IP(D2);//YYYY2
m2:=IP(FP(D2)*100);//MM2
j2:=IP(FP(FP(D2)*100)*100);//JJ2
IF m1<3 THEN m1:=m1+12;a1:=a1-1;
END;
IF D1≤1582.1004
   THEN B:=IP(−2+(a1+4716)/4-1179);
   ELSE B:=IP(a1/400-a1/100+a1/4);
END;
z1:=365*a1-679004+B+2400000.5;
z1:=z1+IP(30.6001*(m1+1))+j1+.5;
IF m2<3 THEN m2:=m2+12;a2:=a2-1;
END;
IF D2≤1582.1004
   THEN B:=IP(−2+(a2+4716)/4-1179);
   ELSE B:=IP(a2/400-a2/100+a2/4);
END;
z2:=365*a2-679004+B+2400000.5;
z2:=z2+IP(30.6001*(m2+1))+j2+.5;
RETURN ABS(z2-z1);
END;

For exemple Year 1987 give 13.02.1987 13.03.1987 13.11.1987
Year 1938 give 13.05.1938 13.13.1938

Surely it is possible to "ameliorer" Enhenced ?

Good night and regards, Gérard.

Gérard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Fridays the 13th, ported to Prime - ggauny@live.fr - 01-14-2015 09:04 PM



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