'=========================================================================== ' Subject: MOVING LIGHTS IN A TUBE Date: 03-17-99 (13:15) ' Author: Jacob Wieles Code: QB, QBasic, PDS, PB ' Origin: jacwls@worldonline.nl Packet: GRAPHICS.ABC '=========================================================================== 'program : MOTION-0.BAS (17-03-99) ' Simple simulation of moving lights in an impossible tube ' with data change in the DAC (Digital Analog Converter) 'auteur : Jacob Wieles 'which basic : PowerBASIC and Q(uick)BASIC defint a-z defsng w rad1=160 rad2=20 '==============>> Try rad2=2 size=2+int((2*rad2+1+7)/8)*2*(2*rad2+1) dim fig(size-1) on error goto NoVGA screen 12 w=timer while timer>> PB set AC (0-15) to (0-15) call SetColor(0,0,42,0) 'DAC (0) (Background color) blue call SetColor(63,0,0,12) 'DAC (12) color Light red call SetColor(0,0,63,5) 'DAC (5) color Light blue call SetColor(0,63,0,10) 'DAC (10) color Light green call SetColor(0,40,0,11) 'DAC (11) color dark Green call SetColor(50,50,0,7) 'DAC (7) yellow call ChangeColor(10,1) 'circle 1 light green for i=2 to 4 'circles 2, 3 and 4 dark green call ChangeColor(11,i) 'color 1-4 next i return simulation: wt=.05 ' try an other value do locate 1,1 print" Hit spacebar for stop."; print" " do for i=0 to 3 call ChangeColor(11,1+i) ' Make the color dark green call ChangeColor(10,4-((6-i) mod 4)) ' Make the color light green w=timer while timer