home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib35a.dsk
/
NOVEMBER.1988
/
SPEEDDRAW.DEMO.bas
< prev
Wrap
BASIC Source File
|
2023-02-26
|
5KB
|
112 lines
1 REM *
2 REM * SPEEDDRAW.DEMO
3 REM * BY JIM SAVAGE
4 REM * COPYRIGHT(C) 1988
5 REM * MICROSPARC, INC.
6 REM * CONCORD, MA 01742
7 REM *
60 A1% = 0:A2% = 0:XC% = 0:YC% = 0:R% = 0: REM PUT VARIABLES WHERE SPEEDDRAW LOOKS FOR THEM
70 ONERR GOTO 1050
80 AMP = 256 * PEEK(1015): IF PEEK(AMP +7) < >38 OR PEEK(AMP +9) < >10 THEN FL$ = "SPEEDDRAW": PRINT CHR$(4);"BRUN";FL$
90 POKE 216,0
100 :
110 REM MENU
120 READ NN: FOR I = 1 TO NN: READ MN$(I): NEXT
130 DATA 6,SPIRALS,LOOPS,POLYGONS,CLOCK,"PIE CHART",QUIT
140 TEXT : HOME : PRINT CHR$(21);: HTAB 14: PRINT "SPEEDDRAW DEMO": PRINT : HTAB 4: PRINT "COPYRIGHT(C) 1988 MICROSPARC, INC.": FOR I = 1 TO 40: PRINT "=";: NEXT : PRINT : PRINT
150 FOR I = 1 TO NN: PRINT : HTAB 14: PRINT I;" - ";MN$(I)
160 NEXT
170 VTAB 20: HTAB 14: PRINT "CHOOSE 1-";NN;: GET A$:A = VAL(A$): IF A <1 OR A >NN THEN 170
180 PRINT : ON A GOTO 220,340,450,550,920
190 HOME : VTAB 23: END
200 :
210 REM SPIRALS
220 A1% = 0:A2% = 45:XC% = 140:YC% = 95:R% = 4
230 HCOLOR= 3: HGR2
240 FOR I = 1 TO 80: & TURN:R% = R% +2: NEXT
250 HGR2 :XC% = 140: FOR I = 1 TO 25
260 R% = I:A1% = 24 *I: & MOVE
270 R% = 3.4 *I: & CIRCLE: NEXT
280 HGR2 : FOR I = 1 TO 40
290 XC% = 140:YC% = 95:R% = I:A1% = 24 *I: & MOVE
300 R% = 3.4 *I: & CIRCLE: NEXT
310 GOTO 140
320 :
330 REM LOOPS
340 A1% = 180:A2% = 0:XC% = 0:YC% = 0:R% = 0
350 A2 = 100 + RND(1) *160
360 A2% = A2:A1% = (180 +A2)/2:XC% = 150:YC% = 26
370 HGR2 : HCOLOR= 3
380 FOR I = 1 TO 24
390 R% = 130:A2% = 50: & TURN
400 R% = 16:A2% = A2: & TURN
410 NEXT : IF PEEK( -16384) >127 THEN POKE -16368,0: GOTO 140
420 GOTO 340
430 :
440 REM POLYGONS
450 A1% = 0:A2% = 0:XC% = 40:YC% = 50:R% = 0: HCOLOR= 3
460 FOR N = 3 TO 8: HGR2
470 NP = 360/N:D = 0
480 FOR R = 35 TO 75 STEP 5:R% = R
490 D = D +1:XC% = 110 -D:YC% = 30 -D
500 FOR A = 90 TO 450 STEP NP:A1% = A: & VECTR
510 NEXT A,R,N
520 GOTO 140
530 :
540 REM CLOCK
550 A1% = 0:A2% = 0:XC% = 140:YC% = 95:R% = 80:PG = 1
560 HOME : VTAB 4: PRINT "ENTER CORRECT TIME---": PRINT : INPUT " HOUR (1-12): ";A$:HR = VAL(A$): IF HR <1 OR HR >12 THEN 560
570 VTAB 8: INPUT " MINUTE (0-59): ";A$:MIN = VAL(A$): IF (MIN <1 AND A$ < >"0") OR MIN >59 THEN 570
580 SEC(1) = 60 *MIN +3600 *HR:SEC(2) = SEC(1) +1:HR(1) = SEC(1)/3600:HR(2) = SEC(2)/3600
590 HGR : HCOLOR= 3: ROT= 0: SCALE= 1: POKE 232,0: POKE 233,96: ONERR GOTO 1050
600 FL$ = "CLOCKNUM": PRINT : PRINT CHR$(4);"BLOAD";FL$
610 POKE 216,0: GOSUB 840: HGR2 : GOSUB 840
620 HCOLOR= 3: GOSUB 780: POKE 230,32: GOSUB 780
630 REM TIME LOOP
640 XC% = 140:YC% = 95: HCOLOR= 0: GOSUB 770:SEC(PG) = SEC(PG) +2: HCOLOR= 3: GOSUB 770
650 IF FL THEN HCOLOR= 0: GOSUB 780:HR(PG) = SEC(PG)/3600: HCOLOR= 3: GOSUB 780: GOTO 670
660 HCOLOR= 0: GOSUB 790:MIN(PG) = SEC(PG)/60: HCOLOR= 3: GOSUB 790
670 XC% = 140:YC% = 95: FOR R = 1 TO 3:R% = R: & CIRCLE: NEXT
680 GOSUB 710:PG = (PG = 1) +1: POKE -16298 -PG,0: POKE 230,PG *32:A = PEEK( -16336) + PEEK( -16336): IF PG = 1 THEN FL = FL = 0
690 FOR I = 1 TO 15: NEXT : ON PEEK( -16384) <128 GOTO 640: POKE -16368,0: GOTO 140
700 REM ALPHA
710 R% = 64: FOR A = 1 TO 12:A1% = 30 *A:XC% = 140:YC% = 95
720 HCOLOR= 0: & SPOT
730 POKE 28,127: DRAW A: NEXT
740 R% = 34:A1% = 0: HCOLOR= 0: & SPOT
750 POKE 28,127: DRAW 13: RETURN
760 REM HANDS
770 XC% = 140:YC% = 95:A1% = (SEC(PG) -3600 * INT(HR(PG))) *6:R% = 70: & RAY: RETURN
780 A1% = HR(PG) *30:R% = 40: GOSUB 800: RETURN
790 A1% = MIN(PG) *6:R% = 64: GOSUB 800: RETURN
800 XC% = 140:YC% = 95: & VECTR
810 A1% = A1% +160:R% = 5: & RAY
820 A1% = A1% +40: & RAY: RETURN
830 REM FACE
840 XC% = 140:YC% = 95: FOR R = 80 TO 79 STEP -1:R% = R: & CIRCLE: NEXT
850 FOR A = 1 TO 60:A1% = 6 *A
860 XC% = 140:YC% = 95
870 R1 = 75: IF A/5 = INT(A/5) THEN R1 = 71
880 R% = R1: & MOVE:R% = 79 -R1: & RAY: NEXT
890 RETURN
900 :
910 REM PIE CHART
920 A1% = 0:A2% = 0:XC% = 140:YC% = 95:R% = 80:SUM = 0: HCOLOR= 3:A1 = 0
930 TEXT : HOME : VTAB 5: INPUT "ENTER NUMBER OF PIECES OF DATA (2-9) ";N$:N = VAL(N$): IF N <2 OR N >9 THEN 930
940 PRINT : PRINT "ENTER THE DATA. PLACE AN 'S' AFTER ANY SEGMENT THAT SHOULD BE SEPARATED.": FOR I = 1 TO N
950 VTAB 12 +I: PRINT "SEGMENT ";I;: INPUT " - ";DA$:DA(I) = VAL(DA$): IF DA(I) = 0 THEN 950
960 FL(I) = 0: IF RIGHT$(DA$,1) = "S" THEN FL(I) = 14
970 SUM = SUM +DA(I): NEXT
980 HGR
990 FOR I = 1 TO N:XC% = 140:YC% = 75:R% = FL(I):DD = 360 *DA(I)/SUM:A1% = A1 +DD/2: & MOVE
1000 R% = 70:A1% = A1: & RAY:A2% = A1 +DD: & ARC:A1% = A2%: & RAY
1010 A1 = A1 +DD: NEXT
1020 VTAB 22: PRINT : PRINT "PRESS RETURN TO CONTINUE ";: POKE -16368,0: GET A$: GOTO 140
1030 :
1040 REM DISK ERROR HANDLER
1050 POKE 216,0:ER = PEEK(222): TEXT
1060 HOME : VTAB 10: PRINT "DISK ERROR"
1070 PRINT : PRINT : IF ER = 6 THEN PRINT "FILE ";FL$;" MUST BE ON THIS DISK": IF PEEK(218) +256 * PEEK(219) = 80 THEN END
1080 IF ER = 8 THEN PRINT "CHECK DRIVE"
1090 PRINT : PRINT "PRESS <RETURN> TO TRY AGAIN ";: GET A$: PRINT : IF FL$ = "CLOCKNUM" THEN 140
1100 GOTO 70