HHC 2018 Programming Contests
10-01-2018, 10:46 AM
Post: #48
 Didier Lachieze Senior Member Posts: 1,631 Joined: Dec 2013
RE: HHC 2018 Programming Contests
Here is a slightly updated version of my PPL program, with some simplification, improvement in the results accuracy using ROUND instead of IP, and also using the Function App to do the calculation of the values for the extrema date, as well as to show graphically the different biorhythms centered around the next extrema date:

Code:
EXPORT EXTREMA(BD) BEGIN   LOCAL d1,d3;   // Find Next Extrema date   N:=DDAYS(BD,Date);   A:=IP(2*N/23-1/2);   B:=IP(2*N/28-1/2);   C:=IP(2*N/33-1/2);   L1:=MAKELIST(23/2*(1/2+I),I,A+1,A+33); L4:=IP(L1);   L2:=MAKELIST(28/2*(1/2+I),I,B+1,B+33);   L3:=MAKELIST(33/2*(1/2+I),I,C+1,C+33); L5:=IP(L3);   D:=MIN(head(INTERSECT(L4,L2)),head(INTERSECT(L2,L5)),head(INTERSECT(L4,L5))​);   E:=DATEADD(BD,D);   // Display results using the Function App: first text, then a graphic view centered on the next extrema   STARTAPP("Function");   F1:='100*SIN(4*ACOS(0)*(X MOD 23)/23)';   F2:='100*SIN(4*ACOS(0)*(X MOD 28)/28)';   F3:='100*SIN(4*ACOS(0)*(X MOD 33)/33)';   Xmin:=D-40; Xmax:=D+40; Ymin:=-110; Ymax:=110;  Xtick:=5; Ytick:=10;   PRINT("Birthday : "+STRING(BD,2,4));   PRINT("Next Extrema Date: "+STRING(E,2,4));   d1:=IFTE(POS(L4,D),L1(POS(L4,D)),D);   d3:=IFTE(POS(L5,D),L3(POS(L5,D)),D);   PRINT("Physical: "+ROUND(F1(d1),0));   PRINT("Emotional: "+ROUND(F2(D),0));   PRINT("Intellectual: "+ROUND(F3(d3),0));   CHECK({1,2,3});UNCHECK({0,4,5,6,7,8,9});   STARTVIEW(1);   RETURN E; END;

Attached File(s) Thumbnail(s)

 « Next Oldest | Next Newest »

 Messages In This Thread HHC 2018 Programming Contests - Joe Horn - 09-13-2018, 02:17 PM RE: HHC 2018 Programming Contests - pier4r - 09-13-2018, 06:29 PM RE: HHC 2018 Programming Contests - Valentin Albillo - 09-13-2018, 10:05 PM RE: HHC 2018 Programming Contests - Zaphod - 09-13-2018, 10:10 PM RE: HHC 2018 Programming Contests - Joe Horn - 09-14-2018, 04:42 AM RE: HHC 2018 Programming Contests - Valentin Albillo - 09-14-2018, 10:28 PM RE: HHC 2018 Programming Contests - toml_12953 - 09-19-2018, 09:57 AM RE: HHC 2018 Programming Contests - Gene - 09-13-2018, 10:56 PM RE: HHC 2018 Programming Contests - rprosperi - 09-13-2018, 11:34 PM RE: HHC 2018 Programming Contests - Gene - 09-14-2018, 12:06 AM RE: HHC 2018 Programming Contests - cyrille de brĂ©bisson - 09-14-2018, 05:28 AM RE: HHC 2018 Programming Contests - Joe Horn - 09-14-2018, 06:18 PM RE: HHC 2018 Programming Contests - RMollov - 09-19-2018, 09:42 AM RE: HHC 2018 Programming Contests - Jlouis - 09-19-2018, 07:00 PM RE: HHC 2018 Programming Contests - Thomas Klemm - 09-19-2018, 10:25 AM RE: HHC 2018 Programming Contests - sasa - 09-19-2018, 11:17 AM RE: HHC 2018 Programming Contests - Joe Horn - 09-19-2018, 12:12 PM RE: HHC 2018 Programming Contests - Eddie W. Shore - 09-19-2018, 12:15 PM RE: HHC 2018 Programming Contests - Eddie W. Shore - 09-21-2018, 12:25 PM RE: HHC 2018 Programming Contests - rprosperi - 09-21-2018, 12:53 PM RE: HHC 2018 Programming Contests - Joe Horn - 09-22-2018, 06:59 PM RE: HHC 2018 Programming Contests - Joe Horn - 09-29-2018, 07:03 PM RE: HHC 2018 Programming Contests - pier4r - 09-29-2018, 07:41 PM RE: HHC 2018 Programming Contests - Csaba Tizedes - 09-30-2018, 11:38 AM RE: HHC 2018 Programming Contests - 3298 - 09-30-2018, 05:32 PM RE: HHC 2018 Programming Contests - Csaba Tizedes - 09-30-2018, 07:16 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 09-30-2018, 08:32 PM RE: HHC 2018 Programming Contests - 3298 - 09-30-2018, 08:47 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 09-30-2018, 09:40 PM RE: HHC 2018 Programming Contests - Didier Lachieze - 09-30-2018, 09:54 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 09-30-2018, 10:22 PM RE: HHC 2018 Programming Contests - Gene - 09-29-2018, 07:22 PM RE: HHC 2018 Programming Contests - Joe Horn - 09-30-2018, 04:42 AM RE: HHC 2018 Programming Contests - grsbanks - 09-30-2018, 04:58 AM RE: HHC 2018 Programming Contests - Didier Lachieze - 09-30-2018, 08:49 PM RE: HHC 2018 Programming Contests - Joe Horn - 09-30-2018, 11:24 PM RE: HHC 2018 Programming Contests - Gene - 10-01-2018, 02:55 AM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-01-2018, 05:15 AM RE: HHC 2018 Programming Contests - sasa - 10-01-2018, 05:31 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-01-2018, 06:09 AM RE: HHC 2018 Programming Contests - sasa - 10-01-2018, 09:54 AM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-01-2018, 04:57 AM RE: HHC 2018 Programming Contests - Didier Lachieze - 10-01-2018, 04:59 AM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-01-2018, 06:21 AM RE: HHC 2018 Programming Contests - 3298 - 10-01-2018, 06:37 AM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-03-2018, 04:20 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-01-2018, 06:38 AM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-01-2018, 06:40 AM RE: HHC 2018 Programming Contests - Werner - 10-01-2018, 01:42 PM RE: HHC 2018 Programming Contests - jjohnson873 - 10-01-2018, 08:38 PM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-01-2018, 09:47 PM RE: HHC 2018 Programming Contests - Didier Lachieze - 10-01-2018 10:46 AM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-01-2018, 09:33 PM RE: HHC 2018 Programming Contests - Werner - 10-02-2018, 06:10 AM RE: HHC 2018 Programming Contests - Fred Lusk - 10-02-2018, 04:15 AM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-02-2018, 08:11 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-02-2018, 04:33 PM RE: HHC 2018 Programming Contests - Eddie W. Shore - 10-03-2018, 12:39 PM RE: HHC 2018 Programming Contests - Namir - 10-04-2018, 06:09 PM RE: HHC 2018 Programming Contests - Joe Horn - 10-02-2018, 08:47 PM RE: HHC 2018 Programming Contests - Werner - 10-03-2018, 02:03 PM RE: HHC 2018 Programming Contests - Didier Lachieze - 10-03-2018, 03:46 PM RE: HHC 2018 Programming Contests - Werner - 10-04-2018, 05:55 AM RE: HHC 2018 Programming Contests - 3298 - 10-04-2018, 02:48 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-04-2018, 03:47 PM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 12:00 AM RE: HHC 2018 Programming Contests - Didier Lachieze - 10-05-2018, 05:07 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 06:22 AM RE: HHC 2018 Programming Contests - Craig Bladow - 06-25-2019, 01:27 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 12:11 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 12:36 AM RE: HHC 2018 Programming Contests - Didier Lachieze - 10-05-2018, 07:45 AM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 12:26 PM RE: HHC 2018 Programming Contests - David Hayden - 10-05-2018, 02:25 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-05-2018, 07:23 PM RE: HHC 2018 Programming Contests - 3298 - 10-05-2018, 08:26 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-05-2018, 09:51 PM RE: HHC 2018 Programming Contests - 3298 - 10-06-2018, 12:07 PM RE: HHC 2018 Programming Contests - Joe Horn - 10-05-2018, 09:32 PM RE: HHC 2018 Programming Contests - Eddie W. Shore - 10-06-2018, 03:15 PM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-06-2018, 10:14 AM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-06-2018, 11:42 AM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-06-2018, 12:48 PM RE: HHC 2018 Programming Contests - Gerson W. Barbosa - 10-06-2018, 03:57 PM RE: HHC 2018 Programming Contests - 3298 - 10-06-2018, 04:21 PM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-06-2018, 06:38 PM RE: HHC 2018 Programming Contests - David Hayden - 10-07-2018, 01:46 PM RE: HHC 2018 Programming Contests - Thomas Klemm - 10-09-2018, 04:48 AM

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