RosettaCodeData/Task/Biorhythms/EasyLang/biorhythms.easy

41 lines
867 B
Text
Raw Permalink Normal View History

2024-04-19 16:56:29 -07:00
birth$ = "1943-03-09"
date$ = "1972-07-11"
# date$ = substr timestr systime 1 10
#
func day d$ .
y = number substr d$ 1 4
m = number substr d$ 6 2
d = number substr d$ 9 2
return 367 * y - 7 * (y + (m + 9) div 12) div 4 + 275 * m div 9 + d - 730530
.
2025-06-11 20:16:52 -04:00
gtextsize 4
2024-04-19 16:56:29 -07:00
func init b$ d$ .
2025-06-11 20:16:52 -04:00
glinewidth 0.2
gline 50 0 50 100
gline 0 50 100 50
2024-04-19 16:56:29 -07:00
for d = -20 to 20
2025-06-11 20:16:52 -04:00
gcircle x 50 0.5
2024-04-19 16:56:29 -07:00
x += 2.5
.
2025-06-11 20:16:52 -04:00
gtext 4 94 b$
gtext 4 88 d$
2024-04-19 16:56:29 -07:00
days = day date$ - day birth$
2025-06-11 20:16:52 -04:00
gtext 4 80 days & " days"
2024-04-19 16:56:29 -07:00
return days
.
2025-06-11 20:16:52 -04:00
proc cycle now cyc t$ col .
gcolor col
gtext 4 cyc * 1.2 - 20 t$
glinewidth 0.5
2025-08-11 18:05:26 -07:00
gpenup
2026-04-30 12:34:36 -04:00
for d = now - 20 step 0.2 to now + 20
2025-06-11 20:16:52 -04:00
y = 50 + 20 * sin (360 * d / cyc)
2025-08-11 18:05:26 -07:00
glineto x y
2026-04-30 12:34:36 -04:00
x += 0.5
2024-04-19 16:56:29 -07:00
.
.
days = init birth$ date$
cycle days 23 "Physical" 900
cycle days 28 "Emotional" 090
cycle days 33 "Intellectual" 009