10 'kaleidoC.bas
20 WIDTH 40
30 KEY OFF
40 SCREEN 0,1,0,0
50 COLOR 7,0
60 CLS
70 D=-1:W=1:S=11:L=5:G=169:M=60
80 DIM R$(S)
90 FOR COUNT = 1 TO L
100 FOR J = 0 TO S
110 A$ = CHR$(RND*222+32)
120 A$ = STRING$(W,A$)
130 IF COUNT = L THEN A$="    "
140 R$(J)=A$
150 NEXT J
160 D=-D
170 P=0:Q=S
180 IF D<0 THEN Q=0:P=S
190 FOR K=P TO Q STEP D
200 COLOR  INT(RND*17)
210 IF COUNT = L THEN COLOR 7
220 FOR J=K TO Q STEP D
230 LOCATE 12+J,20+(K*W),0:PRINT R$(K)
240 LOCATE 12+K,20+(J*W):PRINT R$(K)
250 LOCATE 12-J,20+(K*W):PRINT R$(K)
260 LOCATE 12-K,20+(J*W):PRINT R$(K)
270 LOCATE 12+J,19-(K*W):PRINT R$(K)
280 LOCATE 12+K,19-(J*W):PRINT R$(K)
290 LOCATE 12-J,19-(K*W):PRINT R$(K)
300 LOCATE 12-K,19-(J*W):PRINT R$(K)
310 NEXT J
320 NEXT K
330 FOR N=1 TO 100:NEXT N
340 NEXT COUNT
350 GOTO 90
65000 X$=CHR$(13):KEY 7,"run 65030 "+X$:KEY 8,"run 65140"+X$
65020 'switch to mono
65030 KEY OFF:CLS:LOCATE ,,0:DEF SEG=0:POKE &H410,PEEK(&H410) OR &H30:DEF SEG:SCREEN 0:WIDTH 80:KEY ON:LOCATE ,,1,12,13:END
65130 'switch to color
65140 KEY OFF:CLS:LOCATE ,,0:DEF SEG=0:POKE &H410,(PEEK(&H410) AND &HCF) OR &H10:DEF SEG:WIDTH 40:LOCATE ,,1,6,7:END