start tok64 d64-JewUIT 100 REM ***************** 110 REM ** ** 120 REM ** bar chart ** 130 REM ** ** 140 REM ***************** 150 REM 160 PRINT"{clear}{down}{right}enter values. end with -1. 170 DIMda(200):ct=1 180 PRINT"#"ct,:INPUTda(ct):IFda(ct)<.THENct=ct-1:GOTO210 190 IFda(ct)>hiTHENhi=da(ct) 200 sm=sm+da(ct):ct=ct+1:GOTO180 210 md=sm/ct 230 REM **** graphic routines **** 240 REM **************** 250 in=51200:of=51203 260 gc=51206:sc=51209 270 pc=51212:pl=51215 280 up=51218:sl=51221 290 cl=51224:gl=51227 300 gs=51230:hc=51233 320 REM 330 REM **** axes **** 340 REM **** 350 SYSin:SYSgc:SYSsc,16*7+10 380 xh=300:yh=180:REM # of points in x/y directions (max.) 390 xe=INT(xh/ct):ye=INT(yh/hi*10):REM calculation of (ones) tens 400 SYSsl,10,10,10,190:REM y axis 410 SYSsl,10,190,310,190:REM x axis 420 t=-1:FORy=190TO10STEP-ye 430 t=t+1:IFt/5=INT(t/5)THENSYSsl,5,y,15,y:REM large line 435 IFt/10=INT(t/10)THENSYSsl,3,y,17,y:REM larger line 440 SYSsl,7,y,13,y:REM mark 450 NEXT 460 t=.:be=20+xe/2:REM begin first line 470 FORx=beTO310STEPxe 480 t=t+1:IFt/5=INT(t/5)THENSYSsl,x,195,x,193:REM large line 485 IFt/10=INT(t/10)THENSYSsl,x,198,x,195:REM larger line 490 SYSsl,x,193,x,190:REM mark 500 NEXT 600 REM 610 REM **** chart **** 620 REM ***** 630 br=xe-20:REM calculate bar width 640 po=be-br/2:REM start position of first bar 650 FORt=1TOct 670 y=190-da(t)*ye/10:REM bar height 680 FORx=poTOpo+br:REM bar width 690 SYSsl,x,y,x,190:REM draw bar 700 NEXT 710 po=po+xe:REM new bar position 720 NEXT 725 SYSsl,0,190-md*ye/10,319,190-md*ye/10 730 POKE198,0:WAIT198,255:SYSof:END stop tok64 (bastext 1.0)