60 FOR colour=1 TO 3
70 GC0L0,colour
80 corner=80*colour
90 PR0Crectangle(corner,corner,corner+100,corner+100)
100 NEXT colour
110 ENDPROC
120 DEFPROCmixed
130 FOR colour=16 TO 64 STEP 16
140 GCOL colour,6
150 corner=80*((colour/16)+3)
160 PR0Crectangle(corner,corner,corner+100,corner+100)
170 NEXT colour
180 ENDPROC
190 DEFPR0Crectangle(x,y,11,y1)
200 MOVE x,y
210 PLOT 100,x1,y1
220 ENDPROC
PROCpure draws rectangles in the pure colours following the GCOL 0
command at line 70.
PROCmixed draws rectangles using the patterns. Each time through the loop
the pattern is dictated by the GCOL command at line 140. The first time this is
GCOL 16,0; the next GCOL 32,0; and so on.
The patterns dictated by GCOL16,0 and the other high-numbered GCOL
commands are not fixed, and can be changed by a VDU command. Add the
following lines to the program and run it again:
121 REM gives yellow/black shading for GCOL 16,0
122 VDU23,2,160,80,160,80,160,80,160,80
The command VDU 23,2 changes the pattern produced by GCOL 16,0. The
eight numbers following describe the new pattern -- in this case alternate black
and yellow areas. Similarly, VDU 23,3 can be used to give a new pattern
following GCOL 32,0 and VDU 23,4 changes the pattern produced by GCOL
48,0. Add these lines to get a completely new set of patterns:
123 REM gives Large block red/yellow shading for GCOL 32,0
124 VDU23,3,60,195,60,195,60,195,60,195
125 REM gives black/red shading for GCOL 48,0
126 VDU23,4,5,10,5,10,5,10,5,10
127 REM gives black/white shading for GCOL 64,0
128 VDU23,5,85,170,85,170,85,170,85,170
Working out which eight numbers produce which pattern is a little complex,
and the procedure varies from mode to mode -- you will find it easier to use the
C57