home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib40a.dsk
/
MARCH.1991
/
ALCHEMY.DEMO.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
8KB
|
206 lines
1 REM ******************************
2 REM * ALCHEMY.DEMO *
3 REM * BY JERRY JONGERIUS *
4 REM * COPYRIGHT(C) 1991 *
5 REM * MINDCRAFT PUBL. CORP. *
6 REM * CONCORD, MA 01742 *
7 REM ******************************
8 REM
1000 PRINT : PRINT CHR$(4);"BRUN ALCHEMY"
1010 PRINT CHR$(21): DIM OP$(15)
1020 SET = -1:CLR = -2
1030 DIS = -3:SW = -4
1040 EXR = -5:LFT = -6
1050 UP = -7:CIR = -8
1060 BOX = -9
1070 OP$(1) = "ANIMATED BOX"
1080 OP$(2) = "THREE GRAPHICS PAGES"
1090 OP$(3) = "EXCLUSIVE-OR"
1100 OP$(4) = "FLIP - LEFT/RIGHT"
1110 OP$(5) = "FLIP - UP/DOWN"
1120 OP$(6) = "CIRCLE - SPEED CONTRAST"
1130 OP$(7) = "ELLIPSE - SPEED CONTRAST"
1140 OP$(8) = "CIRCLE - WORLD"
1150 OP$(9) = "CIRCLE - OLYMPICS"
1160 OP$(10) = "CIRCLE - CBS"
1170 TEXT : HOME : PRINT CHR$(17)
1180 HEAD$ = "****************************************": REM 40 *s
1190 HOME : PRINT HEAD$;
1200 PRINT SPC( 8);"<< HI-RES ALCHEMY DEMO >>"
1210 PRINT SPC( 10)"BY JERRY JONGERIUS": PRINT SPC( 6)"(C) 1991 MINDCRAFT PUBL. CORP.": PRINT HEAD$
1220 FOR L = 1 TO 10: HTAB 9 - LEN( STR$(L)): VTAB 7 +L: PRINT "<";L;">";" ";OP$(L): NEXT
1230 HTAB 8: PRINT "<Q> QUIT"
1240 VTAB 21: PRINT "WHICH NUMBER (1-10) ": PRINT "(WHILE DRAWING, <ESC> RETURNS HERE)"
1250 VTAB 21: HTAB 21: INPUT "";N$
1260 IF N$ = "Q" OR N$ = "q" THEN HOME : END
1270 N = VAL(N$): IF N <1 OR N >10 THEN PRINT CHR$(7): GOTO 1250
1280 ON N GOSUB 1300,1540,1740,1940,2150,2360,2530,2610,2750,2860
1290 POKE -16368,0: GOTO 1170
1300 REM **********************
1310 REM * *
1320 REM * ANIMATED BOX *
1330 REM * *
1340 REM **********************
1350 HOME
1360 ST = .035:C = 0: HCOLOR= 3
1370 FOR Y = 1 TO 2:P = USR(CLR),Y,0: NEXT
1380 FOR Y = 1 TO 2: FOR X = 0 TO 2:P = USR(BOX),Y,X,X,279 -X,191 -X: NEXT : NEXT
1390 C = 0:D = 5:E = 5
1400 A = 30 * COS(C) +125:B = 30 * SIN(C) +70
1410 HCOLOR= 3
1420 P = USR(BOX),1,A,B,A +40,B +40
1430 P = USR(DIS),1,1
1440 HCOLOR= 0:P = USR(BOX),2,D,E,D +40,E +40
1450 HCOLOR= 3
1460 C = C +ST:D = 30 * COS(C) +125:E = 30 * SIN(C) +70
1470 P = USR(BOX),2,D,E,D +40,E +40
1480 P = USR(DIS),2,1
1490 HCOLOR= 0
1500 P = USR(BOX),1,A,B,A +40,B +40
1510 C = C +ST
1520 IF PEEK( -16384) = 155 THEN RETURN
1530 GOTO 1400
1540 REM **********************
1550 REM * *
1560 REM * THREE PAGES *
1570 REM * *
1580 REM **********************
1590 HOME : HCOLOR= 3
1600 VTAB 12: HTAB 13: INVERSE : PRINT "DRAWING PICTURES": NORMAL
1610 FOR X = 1 TO 3:Z = USR(CLR),X,0: NEXT
1620 FOR Y = 0 TO 78 STEP 6: FOR X = 0 TO 2:Z = USR(BOX),1,X +Y,X +Y,279 -X -Y,159 -X -Y: NEXT : NEXT
1630 Z = USR(CIR),2,140,80,30,30,.05:Z = USR(BOX),2,110,50,170,110
1640 Z = USR(CIR),3,140,80,30,10,.05
1650 Z = USR(CIR),3,140,80,10,30,.05
1660 FOR X = 1 TO 3:P(X) = X: NEXT
1670 Z = USR(DIS),1,2:B = 1
1680 HOME : VTAB 23: PRINT "WHICH PAGE (1-3)? ";
1690 GET A$: IF A$ = CHR$(27) THEN RETURN
1700 A = VAL(A$): IF A <1 OR A >3 THEN PRINT CHR$(7);: GOTO 1690
1710 Z = USR(SW),P(A),1
1720 Q = P(A):P(A) = 1:P(B) = Q
1730 B = A: GOTO 1680
1740 REM **********************
1750 REM * *
1760 REM * EXCLUSIVE-OR *
1770 REM * *
1780 REM **********************
1790 HOME :P = 1
1800 PRINT "DRAW IN WHICH COLOR ";
1810 GET A$:A = VAL(A$): IF A = 0 OR A = 4 OR A >7 THEN PRINT CHR$(7);: GOTO 1810
1820 Z = USR(SET),P:Z = USR(CLR),P,0:Z = USR(DIS),P,2: HCOLOR= A
1830 FOR X = 0 TO 80 STEP 4
1840 Z = USR(BOX),P,140 -X,X,140 +X,160 -X
1850 NEXT
1860 B = 127: GOSUB 1900
1870 B = 128: GOSUB 1900
1880 B = 255: GOSUB 1900
1890 HOME : VTAB 23: PRINT "PRESS ANY KEY TO RETURN TO MENU ";: GET A$: RETURN
1900 HOME : VTAB 23: PRINT "PRESS A KEY TO EOR THE PAGE WITH ";: INVERSE : PRINT B;: NORMAL : PRINT " ";: GET A$
1910 Z = USR(EXR),1,B
1920 HOME : VTAB 23: PRINT "PRESS ANY KEY TO RETURN PAGE TO NORMAL ";: GET A$
1930 Z = USR(EXR),1,B: RETURN
1940 REM **********************
1950 REM * *
1960 REM * F/F L/R *
1970 REM * *
1980 REM **********************
1990 HOME : PRINT "DRAW IN WHICH COLOR ";
2000 GET A$:A = VAL(A$): IF A = 0 OR A = 4 OR A >7 THEN PRINT CHR$(7);: GOTO 2000
2010 HCOLOR= A:S = .01:P = 1
2020 Z = USR(SET),P
2030 Z = USR(CLR),P,0
2040 Z = USR(DIS),P,2
2050 FOR C = 0 TO 10
2060 Z = USR(BOX),P,50 -C,30 -C,50 +C,130 +C
2070 Z = USR(BOX),P,100 -C,30 -C,100 +C,130 +C
2080 Z = USR(BOX),P,70 -C,80 -C,80 +C,80 +C
2090 Z = USR(BOX),P,160 -C,90 -C,160 +C,130 +C
2100 Z = USR(BOX),P,160 -C,60 -C,160 +C,60 +C
2110 NEXT
2120 HOME : VTAB 23: PRINT "PRESS ANY KEY TO FLIP PICTURE ";
2130 GET A$: IF A$ = CHR$(27) THEN RETURN
2140 Z = USR(LFT),P: GOTO 2120
2150 REM **********************
2160 REM * *
2170 REM * FLIP U/D *
2180 REM * *
2190 REM **********************
2200 HOME : PRINT "DRAW IN WHICH COLOR ";
2210 GET A$:A = VAL(A$): IF A = 0 OR A = 4 OR A >7 THEN PRINT CHR$(7);: GOTO 2210
2220 HCOLOR= A:S = .01
2230 P = 1
2240 Z = USR(SET),P
2250 Z = USR(CLR),P,0
2260 Z = USR(DIS),P,2
2270 Z = USR(BOX),1,80,50,190,120
2280 Z = USR(BOX),1,84,54,166,116
2290 HPLOT 80,120 TO 70,115 TO 70,45
2300 HPLOT 80,50 TO 70,45 TO 180,45 TO 190,50
2310 HPLOT 90,15 TO 130,47 TO 170,15
2320 Z = USR(CIR),1,174,60,3,3,.1:Z = USR(CIR),1,182,60,3,3,.1
2330 HOME : VTAB 23: PRINT "PRESS ANY KEY TO FLIP PICTURE ";
2340 GET A$: IF A$ = CHR$(27) THEN RETURN
2350 Z = USR(UP),P: GOTO 2330
2360 REM **********************
2370 REM * *
2380 REM * CIRCLE - CONTRAST *
2390 REM * *
2400 REM **********************
2410 H2 = 25:S = .03
2420 HOME : HGR : HCOLOR= 3
2430 VTAB 23: PRINT "BASIC VERSION": FOR X = 1 TO 300: NEXT
2440 P1 = 100:P2 = 96:H1 = 25
2450 FOR X = 0 TO 3.14159/2 STEP S
2460 A = H1 * COS(X):B = H2 * SIN(X)
2470 HPLOT P1 +A,P2 +B: HPLOT P1 -A,P2 +B
2480 HPLOT P1 -A,P2 -B: HPLOT P1 +A,P2 -B: NEXT
2490 VTAB 23: PRINT "THE M/L VERSION"
2500 Z = USR(CIR),1,P1 +80,P2,H1,H2,S
2510 FOR X = 1 TO 500: NEXT
2520 VTAB 23: PRINT "PRESS ANY KEY TO RETURN TO THE MENU ";: GET A$: RETURN
2530 REM **********************
2540 REM * *
2550 REM * ELLIPSE - CONTRAST *
2560 REM * *
2570 REM **********************
2580 REM
2590 H2 = 50:S = .02: GOTO 2420
2600 REM
2610 REM **********************
2620 REM * *
2630 REM * CIRCLE - WORLD *
2640 REM * *
2650 REM **********************
2660 HOME
2670 J1 = .01:J2 = .01: HCOLOR= 3
2680 Z = USR(SET),2:Z = USR(CLR),Z,0:Z = USR(DIS),Z,1: FOR X = 0 TO 2:Z = USR(BOX),Z,X,X,279 -X,191 -X: NEXT
2690 HPLOT 140,16 TO 140,174: FOR X = 10 TO 90 STEP 10
2700 Z = USR(CIR),Z,140,95,X,80,J1
2710 IF PEEK( -16384) = 155 THEN RETURN
2720 NEXT
2730 Z = USR(CIR),Z,140,95,90,14,J2
2740 POKE -16368,0: GET A$: RETURN
2750 REM **********************
2760 REM * *
2770 REM * CIRCLE - OLYMPICS *
2780 REM * *
2790 REM **********************
2800 HOME : HCOLOR= 3:Z = USR(SET),1:Z = USR(CLR),Z,0:Z = USR(DIS),Z,2
2810 C2 = 50: RESTORE : FOR K = 1 TO 3: READ C1: GOSUB 2840: NEXT :C2 = 78: FOR K = 1 TO 2: READ C1: GOSUB 2840: NEXT
2820 POKE -16368,0
2830 VTAB 23: PRINT "PRESS ANY KEY TO RETURN TO THE MENU ";: GET A$: RETURN
2840 FOR X = 1 TO 3:Z = USR(CIR),Z,C1,C2,25 +X,25 +X,.02: NEXT : RETURN
2850 DATA 140,80,200,110,170
2860 REM *********************
2870 REM * *
2880 REM * CIRCLE - CBS *
2890 REM * *
2900 REM *********************
2910 HOME : HCOLOR= 3:Z = USR(SET),1:Z = USR(CLR),Z,0:Z = USR(DIS),Z,2
2920 X = 140:Y = 80:H1 = 50:H2 = H1/2:S = .01
2930 Z = USR(CIR),Z,X,Y,H1,H1,S
2940 Z = USR(CIR),Z,X,Y,H2,H2,S
2950 Z = USR(CIR),Z,X,Y,H1,H2,S
2960 VTAB 23: PRINT "PRESS ANY KEY TO RETURN TO THE MENU ";
2970 POKE -16368,0: GET A$: RETURN