8-Bit Software Online Conversion
Shapes demo - Listing
10ONERRORRUN
30MODE7
40PRINT'"Select option:"''"1) STARBUR
ST"''"2) TRIANGLE STARS"''"3) STRING PAT
TERNS"''"4) RANDOM TRIANGLES"''"5) EXIT"
50PRINT''"OPTION.. ":REPEAT:O%=VALGET
$:UNTILO%>0ANDO%<6
60MODE2:VDU23;8202;0;0;0;
70IFO%=1PROCburst
80IFO%=2PROCtriangles
90IFO%=3PROCstring
100IFO%=4PROCrandom
120IFO%=5END ELSE GROO!
130:
140DEFPROCburst
150REPEAT
160FORL%=1TO800
170GCOL3,RND(7)
180MOVE RND(1200),RND(1000)
190DRAW 600,500
200NEXT
230REPEATUNTILGET
240ENDPROC
250:
260DEFPROCtriangles
270Z%=0
280A%=RAD(120):B%=A%+A%
290FORM%=4TO35
300R%=512
310VDU29,640;512;
320FORL%=0TO512/M%:GCOL0,L% MOD 7+1
330MOVER%*COS(Z%),R%*SIN(Z%)
340MOVER%*COS(Z%+A%),R%*SIN(Z%+A%)
350PLOT85,R%*COS(Z%+B%),R%*SIN(Z%+B%)
360Z%=Z%+PI*2/M%:R%=R%-M%
370NEXT
380REPEATUNTILGET
390CLG
400NEXT
410ENDPROC
420:
430DEFPROCstring
440REPEAT
450X%=RND(1280):Y%=RND(1280)
460B%=RND(1280):C%=RND(1024)
470F%=20-RND(40):G%=20-RND(40)
480D%=20-RND(40):E%=20-RND(40)
490FOR L% = 1 TO 300
500MOVEX%,Y%
510DRAWB%,C%
520IF X%+F%>1279 OR X%+F%<0 F%=-F%:GCO
L 0,RND(7)
530IF Y%+G%>1023 OR Y%+G%<0 G%=-G%:GCO
L 0,RND(7)
540IF B%+D%>1279 OR B%+D%<0 D%=-D%:GCO
L 0,RND(7)
550IF C%+E%>1023 OR C%+E%<0 E%=-E%:GCO
L 0,RND(7)
560X%=X%+F%:Y%=Y%+G%
570B%=B%+D%:C%=C%+E%
580NEXT L%
590REPEATUNTILGET
600CLG
610UNTIL FALSE
620ENDPROC
630:
640DEFPROCrandom
650REPEAT
660FORL%=1TO200
670GCOLRND(80),RND(13)
680PLOT85,RND(1200),RND(1000)
690NEXT
700REPEATUNTILGET
710CLG
720UNTIL0
730ENDPROC