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