38 lines
1.1 KiB
Text
38 lines
1.1 KiB
Text
Module Biorhythms (birth, bioDay, N as long = 1) {
|
|
date birth, bioDay, transition
|
|
enum bio {Physical=23, Emotional=28, Mental=33}
|
|
dim quadrants(4)
|
|
quadrants(0):=("up and rising", "peak"), ("up but falling", "transition"), ("down and falling", "valley"), ("down but rising", "transition")
|
|
if N<1 then N=1
|
|
for k=1 to N
|
|
long Days=bioDay-birth
|
|
Print "Day "+bioDay+" | Age in days: "+Days
|
|
string frm="{0:-20} : {1}", pword, dfmt="YYYY-MM-DD"
|
|
long position, percentage, length
|
|
k=each(bio)
|
|
while k
|
|
length=eval(k)
|
|
position=days mod length
|
|
quadrant=int(4*position/length)
|
|
percentage=100*sin(360*position/length)
|
|
transition=bioDay+floor((quadrant+1)/4*length)-position
|
|
select case percentage
|
|
case >95
|
|
pword="peak"
|
|
case <-95
|
|
pword="valley"
|
|
case -5 to 5
|
|
pword="critical "
|
|
case else
|
|
{
|
|
pword=percentage+"% ("+quadrants(quadrant)#val$(0)+", next "
|
|
pword+=quadrants(quadrant)#val$(1)+" "+str$(transition, dfmt)+")"
|
|
}
|
|
end select
|
|
print format$(frm, eval$(k)+" day "+(days mod length), pword)
|
|
End while
|
|
bioDay++
|
|
next k
|
|
}
|
|
form 80
|
|
Biorhythms "1943-03-09", "1972-07-11"
|