new


10 gosub 4000
20 gosub 4300
25 gosub 5400

30 gosub 3200
40 gosub 3000
50 gosub 3100
60 gosub 3400

890 goto 20
900 a$=inkey$:if a$=""then900
1000 screen 1,1,1:cls:end

rem stripes
3000  FOR J=0 TO 511:POKE S+J,C( (J AND 7)+1):next:rem stripes
3020 return

rem diagonal
3100 for y=0tosw-1+sh
3110 for x=0to y:h=y-x
3120 if h<sh and x<sw then poke s+h*sw+x,c((y and7)+1)
3140 next:next
3150 return

rem random fill of screen

3200 for j=0 to 511
3210 r=rnd(1)*9
3220 rx=rnd(sw)-1:ry=rnd(1)*sh
3230 poke s+ry*sw+rx,c(r)
3240 next
3250 return




rem 2x3 rectangle
3300 poke s+oy*sw+ox,c(r)
3310 poke s+(oy+1)*sw+ox,c(r)
3330 poke s+oy*sw+1+ox,c(r)
3340 poke s+(oy+1)*sw+1+ox,c(r)
3360 poke s+oy*sw+2+ox,c(r)
3370 poke s+(oy+1)*sw+2+ox,c(r)
3390 return

rem four part kaleidoscope, three wide and high
3400 for j=0to50
3410 r=int( rnd(1)*9)
3415 for k=0to3
3420 rx=int(rnd(1)*14):ry=int(rnd(1)*7)
3430 ox=29-rx:oy=14-ry:gosub 3300
3440 ox=rx:oy=ry:gosub 3300
3450 ox=rx:oy=14-ry:gosub 3300
3460 ox=29-rx:oy=ry:gosub 3300
3470 next:next
3480 return



rem init
4000 cls:locate 0,0:print"az";
4008 s=49152+512:if peek(s)=97 and peek(s+1)=122 then 4020
4010 s=57344+512:if peek(s)=97 and peek(s+1)=122 then 4020
4012 s=32768+512:if peek(s)=97 and peek(s+1)=122 then 4020
4014 s=40960+512
4020 a=s-512
4022 sw=32:sh=16:rem init
4024 DIM C(9)
4026 C(0)=128:C(1)=143:C(2)=159
4030 C(3)=175:C(4)=191:C(5)=207
4040 C(6)=223:C(7)=239:C(8)=255
4050 cls:print"Screen fun, by James"
4060 print"**Press a key to begin**"
4070 a$=inkey$:j=rnd(2)
4080 if a$=""then4070
4090 cls
4100 x=0:y=0:w=0:h=0:n=0
4120 for j=0to511:poke a+j,64:next
4130 RETURN

4300 for j=0to511:pokes+j,c(0):next:return:rem black stripes




rem 2x3 rectangle
5300 poke s+oy*sw+ox,r
5305 poke a+oy*sw+ox,t
5310 poke s+(oy+1)*sw+ox,r
5315 poke a+(oy+1)*sw+ox,t
5330 poke s+oy*sw+1+ox,r
5335 poke a+oy*sw+1+ox,t
5340 poke s+(oy+1)*sw+1+ox,r
5345 poke a+(oy+1)*sw+1+ox,t
5360 poke s+oy*sw+2+ox,r
5365 poke a+oy*sw+2+ox,t
5370 poke s+(oy+1)*sw+2+ox,r
5375 poke a+(oy+1)*sw+2+ox,t
5390 return



rem four part kaleidoscope, three wide and high
5400 for j=0to50
5410 r=int( rnd(2)*256)
5412 t=int( rnd(1)*256):t=t and99

5420 rx=int(rnd(1)*14):ry=int(rnd(1)*7)
5430 ox=29-rx:oy=14-ry:gosub 5300
5440 ox=rx:oy=ry:gosub 5300
5450 ox=rx:oy=14-ry:gosub 5300
5460 ox=29-rx:oy=ry:gosub 5300
5470 next
5480 for j=0to511:poke a+j,64:next
5490 return



run
