10REM Colour Cycling v2
20REM 05/03/94 (PD)
30
40P%=100:I%=10
50segments=48
60x=640
70y=512
80radius=300
90
100ONERROR RUN
110REPEAT
120REPEAT
130MODE7
140PROCstart
150UNTILG=49 OR G=50 OR G=32
160IFG=32 GOTO 230
170MODE2
180VDU23;8202;0;0;0;
190*FX4,1
200IF G=49 OSCLI("LDPIC WAVES") ELSE P
ROCdrawcircle
210PROCcycle
220UNTIL FALSE
230*FX4,0
240MODE7:PRINT'" This program by:"'" J
ock Smylie (5/3/94) - Australia."'
250END
260
270DEFPROCcycle
280REPEAT
290FORA%=1TO7
300FORB%=1TO7
310C%=(A%+B%)MOD 7
320IFC%=0 C%=7
330VDU19,B%,C%;0;
340NEXT
350FORT%=1TOP%:NEXT
360IF INKEY(0)=138 P%=P%+I%
370IF INKEY(0)=139 P%=P%-I%
380IF INKEY-99 ENDPROC
390IF P%<0 P%=0
400NEXT
410UNTIL FALSE
420ENDPROC
430
440DEFPROCdrawcircle
450A=2*PI/segments
460CS=COS(A)
470SN=SIN(A)
480X1=x
490Y1=y+radius
500MOVE X1,Y1
510FOR steps=1 TO segments
520GCOL0,1+steps MOD 6
530X2=x+(X1-x)*CS-(Y1-y)*SN
540Y2=y+(X1-x)*SN+(Y1-y)*CS
550MOVE x,y
560PLOT 85,X2,Y2
570X1=X2
580Y1=Y2
590NEXT
600ENDPROC
610
620DEFPROCstart
630VDU23;8202;0;0;0;
640PRINT'" C o l o u r C y c l i
n g"
650PRINT''" A program to demonstrate o
ne technique of colour cycling."
660PRINT'" This program was written in
response to a request from Andrew Sn
odgrass for help with his 'Wavey' progr
am in Issue 29 of 8-Bit Software."
670PRINT''" Press <1> for 'Wavey' anim
ation"
680PRINT'" Press <2> for Wheel animat
ion"
690PRINT''" Press up and down cursor k
eys to increase or decrease the r
ate of colour cycling, <SPACE> to
exit."
700PRINT'" Note the circle drawing pro
cedure for a relatively fast circle dr
awing algorithm in Basic.";
710G=GET
720ENDPROC