# Alcolator 1.0 # # 2005 by Jost Jahn # webmaster@jostjahn.de # http://www.jostjahn.de # # autonum new # integer x,y op "ds","Calculating blood alcohole",1,15 op "ds","concentration using formula by",1,25 op "ds","Widmark and Watson.",1,35 op "ds","written by Jost Jahn.",1,45 op "ds","webmaster@jostjahn.de",1,55 op "ds","http://www.jostjahn.de",1,65 xu=10:xo=150:yu=20:yo=130 ymax=3:dy=(yo-yu)/ymax # Grafik geht mit Schleifen nicht. # Warum weiss ich nicht. # grline xu,yu,xu,yo,1 # grline xu,yo,xo,yo,1 # for i=0 to 3 # x=xu:y=yo-dy*i # grline x,y,x-3,y,1 # next i # for i=xu to xo # grline i,yo,i,yo+3,1 # next i input "Give drunken fluid in ml: ",m input "Give volume percent of alcohole: ",v # s = specific weight of alcohole. s=0.79 # rp = resorption coefficient of alcohole. rp=0.9 # a = alcohole in gramm a=int(10*m*v/100*s*rp+0.5)/10 dprint "Drunken alcohole: ";a;" gramm." input "Give your body weight in kg: ",p input "Give your body height in cm: ",h input "Give your age in years: ",t r=0.65 input "Sex: m for man, w for woman: ",g$ if (g$="m") then r=0.7 if (g$="w") then r=0.6 if (g$="c") then r=0.8 ww=0.203-0.07*t+0.1069*h+0.2466*p wm=2.447-0.09516*t+0.1074*h+0.3362*p w=(ww+wm)/2 if (g$="m") then w=wm if (g$="w") then w=ww # alcohole concentration in blood. cc=p*r c=0 if cc>0 then c=a/cc c=int(c*100+0.5)/100 ? "Blood alc (Widmark): ";c;" promille" rho=1.055 d=0.8*a/rho/w d=int(d*100+0.5)/100 dprint "Blood alc (Watson): ";d;" promille" cd=(c+d)/2 e=int(cd/(0.1)+0.5) f=int(a/(p/10)+0.5) ef=(e+f)/2 dprint "Time alcfree: ";ef;" hours" g=int((cd-0.5)/cd*ef+0.5) dprint "Time 0.5%: ";g;" hours" end run