'=========================================================================== ' Subject: GO ROUND Date: 08-15-00 (15:47) ' Author: Jacob Wieles Code: QB, QBasic, PDS, PB ' Origin: j.wieles@hccnet.nl Packet: GRAPHICS.ABC '=========================================================================== 'program : GOROUND.BAS (15-08-2000) 'auteur : Jacob.Wieles ' Playing with sine and cosine and find ?????????????? 'basic : PowerBASIC en Q(uick)Basic defint x,y defdbl a,p dim col(15),x0(15),y0(15),x1(15),y1(15) screen 12 xm=point(0) ym=point(1) window(-xm,-ym)-(xm-1,ym-1) 'Find out on which basic the program runs out &H3C7,15 cr=inp(&H3C9) cg=inp(&H3C9) cb=inp(&H3C9) ' if cr=42 then the program runs on PowerBasic ' if cr=63 then the program runs on Q(uick)Basic timedivisor=100'=====================>> For PowerBASIC if cr=63 then timedivisor=8'=========>> For Q(uick)BASIC 'The value for the timedivisor are found for a Pentium 100 PC 'For an other PC maybe you must change this value 'To prevent flickering monitor and SetUpDrawSpeed t!=timer wp&=0 do while timer< t!+1 wp&=wp&+1 loop DrawLoop&=wp&/timedivisor gosub SetupColor radius=138 pi=4*atn(1) TS$=" Key for stop. " restore ShapeData for picture=1 to 7 Runflag=1 cls read varx1,varx2,vary1,vary2 locate 1,1 print TS$ locate 1,60 print picture;"from 7" k=0 do k=k+1 if k=121 then k=1 anglek=k*2*pi/120 for i=0 to 10 x1(i)=x0(i) y1(i)=y0(i) col=i+1 anglei=i*2*pi/5 angleki=anglek+anglei x0=radius*2*cos(angleki)*cos(angleki/2) y0=radius*1.3*sin(angleki) x1=radius*varx1*sin(angleki*varx2) y1=radius*vary1*cos(angleki*vary2) x0(i)=x0+x1 y0(i)=y0+y1 if i<>0 then line-(x0(i),y0(i)),col(col) else pset(x0(i),y0(i)),col(col) end if next i if k<>1 then for t=0 to 10 line(x1(t),y1(t))-(x0(t),y0(t)),14 next t for w&=0 to DrawLoop&:next w& inv$=inkey$ if inv$<>"" then gosub KeyNext if RunFlag=0 then goto QuitProg if RunFlag=2 then exit do end if loop next picture QuitProg: cls screen 0 print" Hit a key for the source." end SetupColor: restore SetupColorData for i=0 to 15 read col(i) next i return KeyNext: while inkey$<>"":wend RunFlag=1 locate 1,1 print" Key for go on. Esc for end. Enter for next." do keyhit$=inkey$ loop until keyhit$<>"" if keyhit$=chr$(27) then RunFlag=0 if keyhit$=chr$(13) then Runflag=2 locate 1,1 print TS$ return SetupColorData: data 0,9,10,11,12,13,9,10 data 11,12,13,9,10,11,12,13 ShapeData: data 0.300,1.5,0.300,1.5 data 0.250,0.5,0.300,0.5 data 1.500,0.5,0.750,1.0 data 0.500,1.0,0.375,0.5 data 0.300,1.5,0.375,3.0 data 0.300,0.5,0.300,1.0 data 0.750,1.5,0.250,1.5