Add a bunch of samples

This commit is contained in:
Joshua Bell 2020-02-09 21:02:04 -08:00
parent 6c42af4b39
commit 18c88661ac
22 changed files with 1968 additions and 0 deletions

View File

@ -77,6 +77,11 @@ By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
<option value="sample.doordetector">&nbsp; Door Detector (Jeff)</option>
<option value="sample.columns">&nbsp; Columns (Arthur Allen)</option>
<option value="sample.tetris">&nbsp; Tetris (Arthur Allen)</option>
<option value="sample.dicegame">&nbsp; Colorful Dice (Gregory Lewis)</option>
<option value="sample.dicegame">&nbsp; Unfinished Maze (Alexander G. Tozzi)</option>
<option value="sample.dragonsmaze">&nbsp; Dragon's Maze (Russell Hokanson)</option>
<option value="sample.blackhole">&nbsp; Black Hole Maze (S.M.Compton c/o Melody Ayres-Griffiths)</option>
<option value="sample.chase">&nbsp; Chase (Dominik Heidler)</option>
<option disabled>____________________________________________</option>
<option disabled>Graphics</option>
@ -112,6 +117,15 @@ By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
<option value="sample.stellar7">&nbsp; STELLAR 7 Rotate 3d Objects (Golden Child)</option>
<option value="sample.functiongraphing">&nbsp; Function Graphing (Golden Child)</option>
<option value="sample.coloredserpinski">&nbsp; Colored Serpinski Triangles (Gregory Lewis)</option>
<option value="sample.radar">&nbsp; Radar (Josiah Keller)</option>
<option value="sample.moire">&nbsp; Moiré (Sylvie Breaud)</option>
<option value="sample.jobs">&nbsp; Steve Jobs (Nick McMillen / CJBaird)</option>
<option value="sample.dye">&nbsp; Will You Dye (Brett Edwards)</option>
<option value="sample.pretzel">&nbsp; Pretzel (Zee)</option>
<option value="sample.3dcube">&nbsp; 3D Rectangle (Tomo Wa)</option>
<option value="sample.enterprise">&nbsp; Original Series Enterprise (Gil Keidar)</option>
<option disabled>____________________________________________</option>
<option disabled>Other</option>
@ -119,6 +133,14 @@ By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
<option value="sample.february">&nbsp; February Surprise (Antti Pirskanen)</option>
<option value="sample.hellosine">&nbsp; Hello World Sine Wave (Jamie Beu)</option>
<option value="sample.bodymass">&nbsp; Body Mass Index Calculator (Tim Dwyer)</option>
<option value="sample.quine">&nbsp; Quine (Nikolay Mirin)</option>
<option value="sample.10print">&nbsp; 10 PRINT MAZE (translated by Rich Hanes)</option>
<option value="sample.primecheck">&nbsp; Prime Check (Tony Hill)</option>
<option value="sample.vdt">&nbsp; Velocity/Distance/Time (feman1977)</option>
<option value="sample.protonelectron">&nbsp; Proton/Electron Mass Ratio (Mark Rohrbaugh)</option>
<option value="sample.onelinetrain">&nbsp; One Liner Train (Chris ten Den)</option>
<option value="sample.piglatin">&nbsp; Pig Latin Translator (Gregg Buntin)</option>
<option value="sample.nuclear">&nbsp; Nuclear Power Plant (Stephen R. Berggren c/o Kevin Riggle)</option>
<option disabled>____________________________________________</option>
<option disabled>Traveller RPG Utilities</option>

View File

@ -0,0 +1 @@
10 PRINT CHR$(47+(45*INT(2*RND(1)))); : GOTO 10

View File

@ -0,0 +1,36 @@
10 A=0
20 B=90
30 C=179
40 D=269
50 M=0.015
55 HCOLOR=1
60 E=cos(A)
70 F=sin(A)
80 G=cos(B)
90 H=sin(B)
100 I=cos(C)
110 J=sin(C)
120 K=cos(D)
130 L=sin(D)
140 HGR
150 Hplot E/(F+2)*60+100,-1/(F+2)*60+100 to E/(F+2)*60+100,1/(F+2)*60+100
160 Hplot G/(H+2)*60+100,-1/(H+2)*60+100 to G/(H+2)*60+100,1/(H+2)*60+100
170 Hplot I/(J+2)*60+100,-1/(J+2)*60+100 to I/(J+2)*60+100,1/(J+2)*60+100
180 Hplot K/(L+2)*60+100,-1/(L+2)*60+100 to K/(L+2)*60+100,1/(L+2)*60+100
190 Hplot E/(F+2)*60+100,1/(F+2)*60+100 to G/(H+2)*60+100,1/(H+2)*60+100
200 Hplot G/(H+2)*60+100,1/(H+2)*60+100 to I/(J+2)*60+100,1/(J+2)*60+100
210 Hplot I/(J+2)*60+100,1/(J+2)*60+100 to K/(L+2)*60+100,1/(L+2)*60+100
220 Hplot K/(L+2)*60+100,1/(L+2)*60+100 to E/(F+2)*60+100,1/(F+2)*60+100
230 Hplot E/(F+2)*60+100,-1/(F+2)*60+100 to G/(H+2)*60+100,-1/(H+2)*60+100
240 Hplot G/(H+2)*60+100,-1/(H+2)*60+100 to I/(J+2)*60+100,-1/(J+2)*60+100
250 Hplot I/(J+2)*60+100,-1/(J+2)*60+100 to K/(L+2)*60+100,-1/(L+2)*60+100
260 Hplot K/(L+2)*60+100,-1/(L+2)*60+100 to E/(F+2)*60+100,-1/(F+2)*60+100
270 A=M+A
280 B=M+B
290 C=M+C
300 D=M+D
310 If A=360 Then A=0
320 If B=360 Then B=0
330 If C=360 Then C=0
340 If D=360 Then D=0
350 goto 60

View File

@ -0,0 +1,284 @@
100 REM ***********************
110 REM S.M.COMPTON.
120 REM BLACKHOLE.
130 REM 12-12-79.
140 REM ***********************
150 DIM EX(34),EY(34)
160 XOLD = 139:YOLD = 76
170 T1 = 0:T2 = 0
180 GOSUB 2570: REM NAME AND DATE PRINTER.
190 GOSUB 2300: REM INSTRUCTIONS.
200 GOSUB 280: REM CONSTRUCT SCREEN.
210 GOSUB 480: REM DRAW NEW BALL.
220 GOSUB 650: REM OBTAIN FIRE COORDINATES.
230 GOSUB 920: REM CHECK FOR HIT
240 IF HIT = 0 THEN 210: REM RESTART.
250 GOSUB 1650: REM CONSTRUCT EXPLOSION.
260 GOSUB 1910: REM TALLY SCORE.
270 GOTO 210: REM RESTART.
280 REM ***********************
290 REM CONSTRUCT SCREEN
300 REM ***********************
310 HGR
320 HCOLOR= 6
330 FOR I = 0 TO 278 STEP 2
340 HPLOT I,0 TO I,159
350 NEXT I
360 HCOLOR= 4
370 HPLOT 84,159 TO 96,159
380 HPLOT 86,158 TO 94,158
390 HPLOT 88,157 TO 92,157
400 HPLOT 182,159 TO 194,159
410 HPLOT 184,158 TO 192,158
420 HPLOT 186,157 TO 190,157
430 HOME
440 FOR I = 1 TO 21: PRINT : NEXT I
450 PRINT TAB( 10)"BATTERY 1"; TAB( 24)"BATTERY 2"
460 PRINT TAB( 13)T1, TAB( 27)T2
470 RETURN
480 REM ***********************
490 REM DRAW NEW BALL
500 REM ***********************
510 X = INT (139 * RND (1) + 1)
520 X = 2 * X - 1
530 Y = INT (156 * RND (1) + 1)
540 HCOLOR= 6
550 HPLOT XOLD - 1,YOLD - 1 TO XOLD - 1,YOLD + 1
560 HPLOT XOLD + 1,YOLD - 1 TO XOLD + 1,YOLD + 1
570 HCOLOR= 6
580 HPLOT XOLD - 1,YOLD - 1 TO XOLD - 1,YOLD + 1
590 HPLOT XOLD + 1,YOLD - 1 TO XOLD + 1,YOLD + 1
600 HCOLOR= 4
610 HPLOT X - 1,Y - 1 TO X - 1,Y + 1
620 HPLOT X + 1,Y - 1 TO X + 1,Y + 1
630 XOLD = X:YOLD = Y
640 RETURN
650 REM ***********************
660 REM OBTAIN FIRE COORDINATES
670 REM ***********************
680 FOR I = 1 TO 50
690 IF PEEK ( - 16287) > 127 THEN 740
700 IF PEEK ( - 16286) > 127 THEN 830
710 NEXT I
720 B1 = 0:B2 = 0
730 RETURN
740 B1 = 180 - PDL (0) / 1.417
750 IF B1 < 0 THEN B1 = 0
760 IF B1 > 180 THEN B1 = 180
770 B2 = 0
780 IF B1 < > 90 THEN 800
790 B1 = 89.9999
800 M = TAN (B1 / 180 * 3.14159)
810 B = 156 + M * 90
820 RETURN
830 B2 = 180 - PDL (1) / 1.417
840 IF B2 < 0 THEN B2 = 0
850 IF B2 > 180 THEN B2 = 180
860 B1 = 0
870 IF B2 < > 90 THEN 890
880 B2 = 89.9999
890 M = TAN (B2 / 180 * 3.14159)
900 B = 156 + M * 188
910 RETURN
920 REM ***********************
930 REM CHECK FOR HIT
940 REM ***********************
950 IF B1 < > 0 THEN 990
960 IF B2 < > 0 THEN 1320
970 HIT = 0
980 RETURN
990 HCOLOR= 5
1000 IF (( - M * (X + 4) + B) > Y) AND (( - M * (X - 4) + B) < Y) THEN 1250
1010 HIT = 0
1020 IF B1 > 39.5361906 THEN 1100
1030 XS = 279
1040 YS = INT ( - M * 279 + B)
1050 HPLOT 90,156 TO XS,YS
1060 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1070 HCOLOR= 6
1080 HPLOT 90,156 TO XS,YS
1090 RETURN
1100 IF B1 > 119.981589 THEN 1180
1110 YS = 0
1120 XS = INT (B / M)
1130 HPLOT 90,156 TO XS,YS
1140 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1150 HCOLOR= 6
1160 HPLOT 90,156 TO XS,YS
1170 RETURN
1180 XS = 0
1190 YS = INT (B)
1200 HPLOT 90,156 TO XS,YS
1210 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1220 HCOLOR= 6
1230 HPLOT 90,156 TO XS,YS
1240 RETURN
1250 HIT = 1
1260 HPLOT 90,156 TO X,Y
1270 FOR I = 1 TO 5:SB = PEEK ( - 16336): NEXT I
1280 HCOLOR= 6
1290 FOR I = 1 TO 10: NEXT I
1300 HPLOT 90,156 TO X,Y
1310 RETURN
1320 HCOLOR= 5
1330 IF (( - M * (X + 4) + B) > Y) AND (( - M * (X - 4) + B) < Y) THEN 1580
1340 HIT = 0
1350 IF B2 > 59.7436134 THEN 1430
1360 XS = 279
1370 YS = INT ( - M * 279 + B)
1380 HPLOT 188,156 TO XS,YS
1390 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1400 HCOLOR= 6
1410 HPLOT 188,156 TO XS,YS
1420 RETURN
1430 IF B2 > 140.314512 THEN 1510
1440 YS = 0
1450 XS = INT (B / M)
1460 HPLOT 188,156 TO XS,YS
1470 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1480 HCOLOR= 6
1490 HPLOT 188,156 TO XS,YS
1500 RETURN
1510 XS = 0
1520 YS = B
1530 HPLOT 188,156 TO XS,YS
1540 FOR I = 1 TO 10:SB = PEEK ( - 16336): NEXT I
1550 HCOLOR= 6
1560 HPLOT 188,156 TO XS,YS
1570 RETURN
1580 HIT = 1
1590 HPLOT 188,156 TO X,Y
1600 FOR I = 1 TO 5:SB = PEEK ( - 16336): NEXT I
1610 FOR I = 1 TO 10: NEXT I
1620 HCOLOR= 6
1630 HPLOT 188,156 TO X,Y
1640 RETURN
1650 REM **********************
1660 REM CONSTRUCT EXPLOSION
1670 REM **********************
1680 FOR I = 1 TO 10
1690 ES = PEEK ( - 16336) - PEEK ( - 16336)
1700 NEXT I
1710 HCOLOR= 6
1720 HPLOT X,Y
1730 HPLOT X + 1,Y - 1
1740 HCOLOR= 4
1750 FOR J = 4 TO 33
1760 RX = ( - 1) ^ INT (6 * RND (1) + 1)
1770 RY = ( - 1) ^ INT (6 * RND (1) + 1)
1780 XE = X + RX * INT (J / 2 * RND (1) + 1)
1790 YE = Y + RY * INT (J / 2 * RND (1) + 1)
1800 IF XE < 0 OR XE > 279 THEN 1780
1810 IF YE < 0 OR YE > 156 THEN 1790
1820 HPLOT XE,YE
1830 EX(J) = XE
1840 EY(J) = YE
1850 NEXT J
1860 HCOLOR= 6
1870 FOR J = 4 TO 33
1880 HPLOT EX(J),EY(J)
1890 NEXT J
1900 RETURN
1910 REM **********************
1920 REM TALLY SCORE.
1930 REM **********************
1940 IF B1 < > 0 THEN 2100
1950 T2 = T2 + 1
1960 IF T2 = 10 THEN 1990
1970 GOSUB 2250
1980 RETURN
1990 HOME
2000 FOR I = 1 TO 21: PRINT : NEXT I
2010 PRINT TAB( 10)"BATTERY 1" TAB( 24)"BATTERY 2"
2020 PRINT TAB( 10)"** BATTERY 2 WINS !! **"
2030 FOR I = 1 TO 2000: NEXT I
2040 HOME
2050 FOR I = 1 TO 21: PRINT : NEXT I
2060 PRINT TAB( 10)"BATTERY 1" TAB( 24)"BATTERY 2"
2070 T1 = 0:T2 = 0
2080 PRINT TAB( 13)T1 TAB( 27)T2
2090 RETURN
2100 T1 = T1 + 1
2110 IF T1 = 10 THEN 2140
2120 GOSUB 2250
2130 RETURN
2140 HOME
2150 FOR I = 1 TO 21: PRINT : NEXT I
2160 PRINT TAB( 10)"BATTERY 1" TAB( 24)"BATTERY 2"
2170 PRINT TAB( 10)"** BATTERY 1 WINS !! **"
2180 FOR I = 1 TO 2000: NEXT I
2190 T1 = 0:T2 = 0
2200 HOME
2210 FOR I = 1 TO 21: PRINT : NEXT I
2220 PRINT TAB( 10)"BATTERY 1" TAB( 24)"BATTERY 2"
2230 PRINT TAB( 13)T1 TAB( 27)T2
2240 RETURN
2250 HOME
2260 FOR I = 1 TO 21: PRINT : NEXT I
2270 PRINT TAB( 10)"BATTERY 1" TAB( 24)"BATTERY 2"
2280 PRINT TAB( 13)T1 TAB( 27)T2
2290 RETURN
2300 REM **********************
2310 REM INSTRUCTIONS
2320 REM **********************
2330 HOME
2340 PRINT TAB( 11)"** BLACKHOLE **"
2350 PRINT
2360 PRINT "BLACKHOLE IS A GAME FOR ONE OR TWO PLA-"
2370 PRINT "YERS USING THE PADDLES. PADDLE 0 IS "
2380 PRINT "ASSIGNED TO ARTILLARY BATTERY #1 AND"
2390 PRINT "PADDLE 1 IS ASSIGNED TO ARTILLARY BAT-"
2400 PRINT "TERY #2. EACH PADDLE CONTROLS THE ANGLE"
2410 PRINT "OF FIRE AS WELL AS THE FIRING OF A LAS-"
2420 PRINT "ER FROM ITS RESPECTIVE BATTERY. THE OB-"
2430 PRINT "JECT IS TO FIRE YOUR LASER THROUGH ONE"
2440 PRINT "OF THE BLACKHOLES THAT APPEAR AT RANDOM"
2450 PRINT "ABOVE THE BATTERIES."
2460 PRINT
2470 PRINT "RATHER THAN COMPETE FOR THE OPPORTUNITY"
2480 PRINT "TO FIRE YOUR LASER, IT IS RECOMMENDED"
2490 PRINT "THAT THE PLAYERS AGREE TO FIRE TEN"
2500 PRINT "ROUNDS APIECE IN SEQUENCE."
2510 PRINT
2520 PRINT "PRESS <CTRL-C> TO TERMINATE EXECUTION."
2530 PRINT
2540 PRINT "PRESS ANY KEY TO BEGIN."
2550 GET ZZ$
2560 RETURN
2570 REM **********************
2580 REM NAME AND DATE PRINTER
2590 REM **********************
2600 HOME
2610 FOR WZ = 1 TO 22
2620 IF (WZ = 1) OR (WZ = 22) THEN 2650
2630 PRINT "*" TAB( 40)"*";
2640 GOTO 2660
2650 FOR MZ = 1 TO 40: PRINT "*";: NEXT MZ
2660 NEXT WZ
2670 NZ$ = "S.M.COMPTON"
2680 DZ$ = "12-12-79"
2690 GZ$ = "BLACKHOLE"
2700 SZ = - 16336
2710 VTAB 9
2720 HTAB 15
2730 FOR WZ = 1 TO 11
2740 PRINT MID$ (NZ$,WZ,1);
2750 SOUND = PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ)
2760 FOR MZ = 1 TO 150: NEXT MZ
2770 NEXT WZ
2780 VTAB 11
2790 HTAB 16
2800 FOR WZ = 1 TO 8
2810 PRINT MID$ (DZ$,WZ,1);
2820 SOUND = PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ)
2830 FOR MZ = 1 TO 150: NEXT MZ
2840 NEXT WZ
2850 VTAB 13
2860 HTAB 16
2870 FOR WZ = 1 TO 9
2880 PRINT MID$ (GZ$,WZ,1);
2890 SOUND = PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ) + PEEK (SZ) - PEEK (SZ)
2900 FOR MZ = 1 TO 150: NEXT MZ
2910 NEXT WZ
2920 FOR WZ = 1 TO 500: NEXT WZ
2930 RETURN

111
samples/sample.chase.txt Normal file
View File

@ -0,0 +1,111 @@
100 PRINT "THIS IS THE GAME OF CHASE"
110 PRINT "WANT INSTRUCTIONS";
120 INPUT C$
130 IF LEFT$(C$,1)="N" THEN 230
140 IF LEFT$(C$,1)<>"Y" THEN 110
150 PRINT "YOU ARE '*' IN A HIGH VOLTAGE MAZE WITH 5"
160 PRINT "SECURITY MACHINES '+' TRYING TO DESTROY YOU"
170 PRINT "YOU MUST MANEUVER THE SECURITY MACHINES INTO"
180 PRINT "THE MAZE 'X' TO SURVIVE. GOOD LUCK !!!"
190 PRINT "MOVES ARE 7,8,9"
200 PRINT " 4,5,6"
210 PRINT " 1,2,3 0 TO END THE GAME"
220 PRINT
230 DIM A(10,20),E(21),F(21)
240 LET G=0
250 FOR B=1 TO 10
260 FOR C=1 TO 20
270 LET A(B,C)=0
280 IF B=1 THEN 330
290 IF B=10 THEN 330
300 IF C=1 THEN 330
310 IF C=20 THEN 330
320 GOTO 340
330 LET A(B,C)=1
340 NEXT C
350 NEXT B
360 FOR D=1 TO 21
370 LET B=INT(RND(1)*8)+2
380 LET C=INT(RND(1)*18)+2
390 IF A(B,C)<>0 THEN 370
400 LET A(B,C)=1
410 IF D<6 THEN 430
420 GOTO 440
430 LET A(B,C)=2
440 IF D=6 THEN 460
450 GOTO 470
460 LET A(B,C)=3
470 LET E(D)=B
480 LET F(D)=C
490 NEXT D
500 FOR B=1 TO 10
510 FOR C=1 TO 20
520 IF A(B,C)<>0 THEN 550
530 PRINT " ";
540 GOTO 630
550 IF A(B,C)<>1 THEN 580
560 PRINT "X";
570 GOTO 630
580 IF A(B,C)<>2 THEN 610
590 PRINT "+";
600 GOTO 630
610 IF A(B,C)<>3 THEN 630
620 PRINT "*";
630 NEXT C
640 PRINT
650 NEXT B
660 LET B=E(6)
670 LET C=F(6)
680 LET A(B,C)=0
690 INPUT Y
700 ON Y+1 GOTO 1040,730,730,730,740,780,740,710,710,710
710 LET B=B-1
720 GOTO 740
730 LET B=B+1
740 ON Y GOTO 750,780,770,750,780,770,750,780,770
750 LET C=C-1
760 GOTO 780
770 LET C=C+1
780 IF A(B,C)=1 THEN 1060
790 IF A(B,C)=2 THEN 1080
800 LET A(B,C)=3
810 LET E(6)=B
820 LET F(6)=C
830 FOR D=1 TO 5
840 IF A(E(D),F(D))<>2 THEN 1020
850 LET A(E(D),F(D))=0
860 IF E(D)>=B THEN 890
870 LET E(D)=E(D)+1
880 GOTO 910
890 IF E(D)=B THEN 910
900 LET E(D)=E(D)-1
910 IF F(D)>=C THEN 940
920 LET F(D)=F(D)+1
930 GOTO 960
940 IF F(D)=C THEN 960
950 LET F(D)=F(D)-1
960 IF A(E(D),F(D))=3 THEN 1080
970 IF A(E(D),F(D))=0 THEN 1000
980 LET G=G+1
990 GOTO 1010
1000 LET A(E(D),F(D))=2
1010 IF G=5 THEN 1100
1020 NEXT D
1030 GOTO 500
1040 PRINT "SORRY TO SEE YOU QUIT"
1050 GOTO 1110
1060 PRINT "ZAP!!! YOU TOUCHED THE FENCE !!!!!"
1070 GOTO 1110
1080 PRINT "** YOU HAVE BEEN DESTROYED BY A LUCKY COMPUTER **"
1090 GOTO 1110
1100 PRINT "YOU ARE LUCKY **YOU DESTROYED ALL THE ENEMY**"
1110 PRINT "WANT TO PLAY AGAIN";
1120 INPUT C$
1130 IF LEFT$(C$,1)="Y" THEN 240
1140 IF LEFT$(C$,1)<>"N" THEN 1110
1150 PRINT "HOPE YOU DON'T FEEL FENCED IN."
1160 PRINT "TRY AGAIN SOMETIME"
1170 END
1140 IF LEFT$(C$,1)<>"N" THEN 1110
1150 PRINT "HOPE YOU DON'T FEEL FENCED IN."
1160 PRINT "TRY AGAIN SOMET

View File

@ -0,0 +1 @@
COLORED SERPINSKI TRIANGLES

View File

@ -0,0 +1,81 @@
100 REM DICE GAME
110 PR#0:DIM RW$(11)
120 FOR I=0 to 11:READ ST$:RW$(I)=ST$:NEXT
130 DATA "Fabulous!","Oh yeah!"
140 DATA "Impressive!","Sensational!"
150 DATA "You are a star!","Excellent!"
160 DATA "My hero!","Top student!"
170 DATA "Stunning!","What a brain!"
180 DATA "Terrific work!","Too easy for you!"
190 DIM SR$(9)
200 FOR I=0 to 9:READ ST$:SR$(I)=ST$:NEXT
210 DATA "Sorry,","Hmmm,","Not quite,"
220 DATA "Try again,","Keep at it,"
230 DATA "Careful,","Steady,"
240 DATA "Next time,","Stay calm,","D'oh,"
300 REM MAIN LOOP
310 SC=0:DG=0:SD=RND(-PEEK(78)-PEEK(79)*256)
320 HOME:GR:X=1:Y=9
330 IF SC=5 THEN HOME:SC=0
340 GOSUB 500:AN=RN:X=14
350 GOSUB 500:AN=AN+RN:X=27
360 GOSUB 500:AN=AN+RN
370 HOME:VTAB 21:HTAB 7
380 INPUT "Add the dice together = ";IN:VTAB 23
390 IF IN=AN THEN GOSUB 8000:HTAB HT:PRINT A$
400 IF IN<>AN THEN HTAB 17:GOSUB 9000:HTAB HT:PRINT A$
410 VTAB 24:HTAB 7
420 PRINT "Press any key to continue. ";
430 GET IN$:GOTO 320
500 REM DRAW DICE
510 C1=INT(RND(1)*15)+1:C2=INT(RND(1)*16)
520 IF C1=C2 THEN GOTO 510
530 IF C1=5 OR C1=10 THEN C1=15:C2=1
540 COLOR=C1:HLIN X+1,X+10 AT Y
550 FOR V=1 TO 20:HLIN X,X+11 AT Y+V:NEXT
560 HLIN X+1,X+10 AT Y+21:COLOR=C2
570 RN=INT(RND(1)*6)+1:DG=1-DG
580 ON RN GOSUB 1000,2000,3000,4000,5000,6000:RETURN
1000 REM ONE
1010 DX=X+5:DY=Y+9:GOSUB 7000:RETURN
2000 REM TWO
2010 IF DG THEN DX=X+3:DY=Y+5:GOSUB 7000:DX=X+7:DY=Y+12:GOSUB 7000
2020 IF NOT DG THEN DX=X+7:DY=Y+5:GOSUB 7000:DX=X+3:DY=Y+12:GOSUB 7000
2030 RETURN
3000 REM THREE
3010 IF DG THEN DX=X+2:DY=Y+4:GOSUB 7000:DX=X+8:DY=Y+14:GOSUB 7000
3020 IF NOT DG THEN DX=X+8:DY=Y+4:GOSUB 7000:DX=X+2:DY=Y+14:GOSUB 7000
3030 GOSUB 1000:RETURN
4000 REM FOUR
4010 DX=X+2:DY=Y+4:GOSUB 7000
4020 DX=X+8:DY=Y+4:GOSUB 7000
4030 DX=X+2:DY=Y+14:GOSUB 7000
4040 DX=X+8:DY=Y+14:GOSUB 7000
4050 RETURN
5000 REM FIVE
5010 GOSUB 4000:GOSUB 1000:RETURN
6000 REM SIX
6010 GOSUB 4000
6020 IF DG THEN DX=X+5:DY=Y+4:GOSUB 7000:DX=X+5:DY=Y+14:GOSUB 7000
6030 IF NOT DG THEN DX=X+2:DY=Y+9:GOSUB 7000:DX=X+8:DY=Y+9:GOSUB 7000
6040 RETURN
7000 REM DRAW SPOT
7010 FOR V=0 TO 3:HLIN DX,DX+1 AT DY+V:NEXT:RETURN
8000 REM GIVE REWARD
8010 SC=SC+1
8020 A$=RW$(RND(1)*10) + " " + STR$(SC) + "/5"
8030 HT=20-INT((LEN(A$)/2)):RETURN
9000 REM GIVE ENCOURAGEMENT
9010 A$=SR$(RND(1)*10) + " answer is " + STR$(AN)
9020 HT=19-INT((LEN(A$)/2)):RETURN

View File

@ -0,0 +1,208 @@
1 TEXT: HOME
2 PRINT "WELCOME TO THE DRAGON'S MAZE"
3 PRINT "YOU MAY WATCH WHILE I BUILD A MAZE,"
4 PRINT "BUT WHEN IT'S COMPLETE, I'LL ERASE"
5 PRINT "THE PICTURE. THEN YOU'LL ONLY SEE THE WALLS AS YOU BUMP INTO THEM."
6 PRINT "TO MOVE, YOU HIT 'R' FOR RIGHT,"
7 PRINT "'L' FOR LEFT, 'U' FOR UP, AND"
8 PRINT "'D' FOR DOWN. DO NOT HIT RETURN!"
9 PRINT
10 PRINT "THE OBJECT IS FOR YOU (THE GREEN DOT"
11 PRINT "TO GET TO THE DOOR ON THE RIGHT SIDE"
12 PRINT "BEFORE THE DRAGON (THE RED DOT) EATS"
13 PRINT "YOU."
14 PRINT "BEWARE!!!!!!!!! SOMETIMES THE DRAGON"
15 PRINT "GETS REAL MAD, AND CLIMBS OVER A WALL."
16 PRINT "BUT MOST OF THE TIME, HE CAN'T GO OVER"
17 PRINT "AND HAS TO GO AROUND."
18 PRINT
19 PRINT "(HINT: YOU CAN OFTEN TELL WHERE A WALL"
20 PRINT "IS, EVEN BEFORE YOU CAN SEE IT, BY"
21 PRINT "THE FACT THAT THE DRAGON CAN'T GET"
22 PRINT "THROUGH IT!)"
23 PRINT
99 DIM A$(3), M(169), T(169)
100 PRINT "ENTER GAME # TO BEGIN ";: INPUT A: IF A<=0 THEN 100
110 A=RND(-ABS(A)): BL=0: WH=15: RD=1: GN=12
120 GR: COLOR=WH
130 HOME: VTAB (21): PRINT "DRAGON MAZE" TAB(25) "GARY J. SHANNON": PRINT TAB(4) "(Applesoft port) RUSSELL A. HOKANSON"
140 FOR I=0 TO 39 STEP 3: VLIN 0,39 AT I: HLIN 0,39 AT I: NEXT I
150 COLOR=BL
160 S=1000
1000 REM INITIALIZE ARRAYS, STARTING POINT AND PROCESSED COUNT
1000 FOR I=1 TO 169: T(I)=0: M(I)=11: NEXT I
1010 X=INT(RND(1)*13)+1: Y=INT(RND(1)*13)+1: C=169
1035 IF C=1 THEN 1200
1040 R=0: D=0: L=0: U=0: K=X+13*(Y-1): M(K)=-ABS(M(K)): C=C-1
1050 IF X=13 THEN 1060
1051 R=M(K+1)>0
1060 IF Y=13 THEN 1070
1061 D=M(K+13)>0
1070 IF X=1 THEN 1080
1071 L=M(K-1)>0
1080 IF Y=1 THEN 1090
1081 U=M(K-13)>0
1090 Q=R+D+L+U
1100 IF (Q<3 AND INT(RND(1)*10)<2) OR Q=0 THEN 1170
1110 DR=INT(RND(1)*4): REM CHOOSE A DIRECTION (0-RIGHT, 1-DOWN, 2-LEFT, 3-UP)
1121 IF DR=1 THEN 1140
1122 IF DR=2 THEN 1150
1123 IF DR=3 THEN 1160
1130 IF NOT R THEN 1110: REM R-RIGHT
1131 M(K)=M(K)+1: X=X+1
1135 VLIN 3*Y-2,3*Y-1 AT 3*(X-1)
1136 GOTO 1035
1140 IF NOT D THEN 1110: REM D-DOWN
1141 M(K)=M(K)+10: Y=Y+1
1145 HLIN 3*X-2,3*X-1 AT 3*(Y-1)
1146 GOTO 1035
1150 IF NOT L THEN 1110: REM L-LEFT
1151 M(K-1)=M(K-1)-1: X=X-1
1155 VLIN 3*Y-2,3*Y-1 AT 3*X
1156 GOTO 1035
1160 IF NOT U THEN 1110: REM U-UP
1161 M(K-13)=M(K-13)-10: Y=Y-1
1165 HLIN 3*X-2,3*X-1 AT 3*Y: GOTO 1035
1170 X=INT(RND(1)*13)+1: Y=INT(RND(1)*13)+1: REM SELECT RANDOM POSITION
1180 IF M(X+13*(Y-1))>0 THEN 1170
1190 C=C+1: GOTO 1035
1200 GOSUB 5000: PRINT "THE MAZE IS READY"
1205 GR: COLOR=WH
1210 VLIN 0,39 AT 0: VLIN 0,39 AT 39: HLIN 0,39 AT 0: HLIN 0,39 AT 39
1220 X=1: Y=INT(RND(1)*13)+1: HX=3*X-2: HY=3*Y-2: FOR K=0 TO 1: FOR L=0 TO 1: COLOR=GN: PLOT HX+K,HY+L: NEXT L,K
1230 WY=INT(RND(1)*13)+1
1240 COLOR=BL: VLIN 3*WY-2,3*WY-1 AT 39
1250 SX=13: SY=WY
1260 QX=3*SX-2: QY=3*SY-2
1500 K= PEEK(-16384): IF K<128 THEN 1500
1510 POKE -16368,0
1515 QQ=K: GOSUB 7000: K=QQ
1516 IF SX=X AND SY=Y THEN 8000
1520 IF K=ASC("R") THEN 2000
1521 IF K=210 THEN 2000
1522 IF K=242 THEN 2000
1530 IF K=ASC("L") THEN 2500
1531 IF K=204 THEN 2500
1532 IF K=236 THEN 2500
1540 IF K=ASC("U") THEN 3000
1541 IF K=213 THEN 3000
1542 IF K=245 THEN 3000
1550 IF K=ASC("D") THEN 3500
1551 IF K=196 THEN 3500
1552 IF K=228 THEN 3500
1560 GOSUB 5000: GOTO 1500
1999 END
2000 DX=1: DY=0: REM RIGHT
2005 IF X=13 THEN 4000
2010 P1=M(X+13*(Y-1)): GOSUB 9000: IF MOD>0 THEN 4000
2020 FX=3*X-2: FY=3*Y-2: FOR I=1 TO 3
2030 FX=FX+DX: FY=FY+DY
2040 COLOR=BL
2060 FOR K=0 TO 1: FOR L=0 TO 1: PLOT HX+K,HY+L: NEXT L,K: COLOR=GN: FOR K=0 TO 1: FOR L=0 TO 1: PLOT FX+K,FY+L: NEXT L,K: HX=FX: HY=FY
2110 NEXT I
2115 X=X+DX: Y=Y+DY
2116 IF X=13 AND Y=WY THEN 6000
2120 GOTO 1500
2500 DX=-1: DY=0: REM LEFT
2505 IF X=1 THEN 4100
2510 P1=M(X+13*(Y-1)-1): GOSUB 9000: IF MOD>0 THEN 4100
2520 GOTO 2020
3000 DX=0: DY=-1: REM UP
3005 IF Y=1 THEN 4200
3010 IF INT(ABS(M(X+13*(Y-2)))/10)>0 THEN 4200
3020 GOTO 2020
3500 DX=0: DY=1: REM DOWN
3505 IF Y=13 THEN 4300
3510 IF INT(ABS(M(X+13*(Y-1)))/10)>0 THEN 4300
3520 GOTO 2020
4000 GOSUB 5000
4010 COLOR=WH
4020 VLIN 3*(Y-1),3*Y AT 3*X
4030 GOTO 1500
4100 GOSUB 5000
4110 COLOR=WH
4120 VLIN 3*(Y-1),3*Y AT 3*(X-1)
4130 GOTO 1500
4200 GOSUB 5000
4210 COLOR=WH
4220 HLIN 3*(X-1),3*X AT 3*(Y-1)
4230 GOTO 1500
4300 GOSUB 5000
4310 COLOR=WH
4320 HLIN 3*(X-1),3*X AT 3*Y
4330 GOTO 1500
5000 S=S-1: FOR I=1 TO 20: A=PEEK(-16336) + PEEK(-16336) + PEEK(-16336) + PEEK(-16336): NEXT I: RETURN
6000 PRINT "YOU WIN!"
6010 GOSUB 5000: GOSUB 5000: GOSUB 5000
6020 PRINT "SCORE=";S+3
6030 END
7000 REM DRAGON SUB ROUTINE
7000 IF X>SX THEN 7050: REM RIGHT
7001 IF Y>SY THEN 7100: REM DOWN
7002 IF X<SX THEN 7150: REM LEFT
7003 IF Y<SY THEN 7200: REM UP
7050 REM RIGHT
7050 IF SX=13 THEN 7100
7060 IF T(SX+13*(SY-1))>9 THEN 7080
7070 P1=M(SX+13*(SY-1)): GOSUB 9000: IF MOD>0 THEN 7100
7080 DX=1: DY=0: GOTO 7300
7100 REM DOWN
7100 IF SY=13 THEN 7150
7110 IF T(SX+13*(SY-1))>9 THEN 7130
7120 IF INT(ABS(M(SX+13*(SY-1)))/10) THEN 7150
7130 DX=0: DY=1: GOTO 7300
7150 REM LEFT
7150 IF SX=1 THEN 7200
7160 IF T(SX+13*(SY-1))>9 THEN 7180
7170 P1=M(SX+13*(SY-1)-1): GOSUB 9000: IF MOD>0 THEN 7200
7180 DX=-1: DY=0: GOTO 7300
7200 REM UP
7200 IF SY=1 THEN 7050
7210 IF T(SX+13*(SY-1))>9 THEN 7230
7220 IF INT(ABS(M(SX+13*(SY-1)-13))/10) THEN 7050
7230 DX=0: DY=-1: GOTO 7300
7300 REM DRAW WALLS/DRAGON
7300 COLOR=BL
7310 RX=3*SX-2: RY=3*SY-2
7320 FOR I=1 TO 3: RX=RX+DX: RY=RY+DY
7330 COLOR=BL: FOR K=0 TO 1: FOR L=0 TO 1: PLOT QX+K,QY+L: NEXT L,K
7340 COLOR=RD: FOR K=0 TO 1: FOR L=0 TO 1: PLOT RX+K,RY+l: NEXT L,K: QX=RX: QY=RY
7350 NEXT I
7360 REM UPDATE DRAGON WALLS
7360 SX=SX+DX: SY=SY+DY
7370 T(SX+13*(SY-1))=T(SX+13*(SY-1))+1
7380 RETURN
8000 GOSUB 5000: GOSUB 5000: GOSUB 5000: GOSUB 5000: PRINT "THE DRAGON GON GOT YOU!": END
9000 REM MOD: Remainder of P1 is returned in MOD
9000 MOD=ABS(P1)-10*INT(ABS(P1)/10): RETURN

29
samples/sample.dye.txt Normal file
View File

@ -0,0 +1,29 @@
1 normal
10 home: gr
11 Print "You Will Dye"
12 for t = 1 to 3000 : next t
13 Print "No I will colour in the screen
14 for t = 1 to 3000 : next t
15 Print "Not If I rub You Out"
19 color = 0
20 plot 10,10
30 x = 3: y = 3: dx = 1: dy = 1
35 a = 3: b = 3: da = 1: db = 1
40 x = x + dx: y = y + dy
41 if rnd(1) < 0.8 then dx = -dx
50 if x > 35 then dx = -1
51 if x < 5 then dx = 1
52 if y > 35 then dy = -1
53 if y < 5 then dy = 1
55 color = 14: plot x,y
58 color = rnd(1)*10: : plot x,y
140 a = a + da: b = b + db
141 if rnd(1) < 0.01 then da = -da
150 if a > 35 then da = -1
151 if a < 5 then da = 1
152 if b > 35 then db = -1
153 if b < 5 then db = 1
155 color = 2: plot a,b
156 for t = 1 to 200: next t
158 color = 0: : plot a,b
170 goto 40

View File

@ -0,0 +1,31 @@
5 HOME
10 GR
20 COLOR=5
30 HLIN 10,20 AT 15
40 HLIN 12,18 AT 14
50 COLOR=13
60 HLIN 15,16 AT 13
65 COLOR=5
70 HLIN 13,17 AT 16
80 COLOR=13
90 HLIN 15,15 AT 17
95 COLOR=5
100 HLIN 18,20 AT 16
110 HLIN 19,21 AT 17
120 HLIN 20,22 AT 18
130 HLIN 21,23 AT 19
140 HLIN 21,26 AT 20
150 HLIN 21,25 AT 21
160 HLIN 21,24 AT 22
170 COLOR=8
180 HLIN 20,20 AT 21
190 COLOR=5
200 HLIN 25,26 AT 19
210 HLIN 26,27 AT 18
220 HLIN 27,28 AT 17
230 HLIN 24,30 AT 16
240 HLIN 24,31 AT 15
250 COLOR=9
260 HLIN 24,24 AT 15
265 HLIN 24,24 AT 16
270 PRINT "THE ORIGINAL SERIES ENTERPRISE"

274
samples/sample.jobs.txt Normal file
View File

@ -0,0 +1,274 @@
0 REM *********************
1 REM * Originally shared *
2 REM * by CJBaird *
3 REM *********************
4 REM http://kildall.apana.org.au/~cjb/sj.applesoft
5 REM
10 HGR2
20 X%=0:Y%=0:C%=3
30 HCOLOR=C%:READP%
40 IFP%=0THENC%=3-C%:GOTO30
50 HPLOTX%,Y%
60 P%=P%-1
70 X%=X%+1:IF X%<280THEN40
80 X%=0:Y%=Y%+1:IFY%<192THEN40
90 PRINTCHR$(7);CHR$(7)
100 GOTO 100
999 :
1000 DATA 970,6,1,1,270,3,1,1,2,8,262,1,1,3
1001 DATA 1,4,1,11,255,27,249,34,244,39,239
1002 DATA 43,235,46,233,49,228,53,226,56
1003 DATA 223,58,220,61,218,63,216,30,1,34
1004 DATA 214,22,1,10,1,33,211,21,1,4,1,8,1
1005 DATA 3,1,30,209,17,2,2,1,11,1,1,1,36
1006 DATA 208,13,1,4,1,3,1,3,1,1,1,1,1,2,1
1007 DATA 2,1,1,1,1,1,12,1,19,206,13,1,2,1
1008 DATA 3,1,4,1,9,1,2,1,1,1,1,1,3,1,6,1,2
1009 DATA 1,18,205,13,1,1,1,1,2,2,1,5,1,2,1
1010 DATA 1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,8
1011 DATA 1,18,203,12,1,1,1,1,1,1,1,1,1,3,1
1012 DATA 1,1,2,1,2,1,6,1,2,1,1,1,3,1,1,1,1
1013 DATA 1,1,1,1,1,3,1,16,202,13,1,1,1,1,1
1014 DATA 1,1,1,1,1,1,1,1,1,1,3,1,2,2,1,1,3
1015 DATA 1,3,2,1,1,1,1,1,1,1,1,2,1,1,1,3,1
1016 DATA 15,200,12,1,1,1,1,3,1,2,1,1,3,1,2
1017 DATA 2,1,1,1,1,1,1,1,1,2,1,5,1,1,1,1,1
1018 DATA 1,1,2,1,2,1,1,1,18,199,13,3,2,1,1
1019 DATA 2,1,1,1,1,1,2,3,1,1,1,1,3,1,1,2,1
1020 DATA 1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1
1021 DATA 1,17,198,12,5,1,3,1,2,1,1,1,1,1,1
1022 DATA 1,2,1,1,1,5,1,1,1,1,1,1,1,1,2,1,2
1023 DATA 1,2,1,1,1,2,1,2,1,16,197,13,5,1,1
1024 DATA 1,2,1,3,1,1,2,1,1,5,1,4,1,2,2,1,1
1025 DATA 1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1026 DATA 17,195,11,3,1,6,1,3,1,2,1,2,1,1,1
1027 DATA 5,1,4,1,1,1,1,1,1,1,2,1,1,1,1,1,1
1028 DATA 1,1,1,1,22,194,12,3,1,8,1,2,1,1,1
1029 DATA 5,1,13,1,1,3,1,1,1,1,1,1,1,1,1,1
1030 DATA 2,1,1,18,194,11,1,1,9,1,4,1,8,1
1031 DATA 12,1,3,2,1,1,1,1,1,1,1,1,1,23,192
1032 DATA 13,1,1,8,1,7,1,19,2,3,1,2,1,1,1,1
1033 DATA 1,1,1,1,1,1,20,190,12,14,1,27,1,1
1034 DATA 1,1,1,1,1,1,1,1,1,1,5,1,18,190,13
1035 DATA 8,1,1,1,24,1,5,1,1,1,2,1,1,1,1,1
1036 DATA 1,1,1,1,1,2,1,19,189,11,16,1,29,1
1037 DATA 2,2,1,1,1,1,1,3,1,20,188,13,2,1
1038 DATA 40,1,6,1,1,1,1,1,2,2,1,20,186,12
1039 DATA 1,1,45,1,4,1,2,1,1,2,1,23,185,13
1040 DATA 1,1,44,1,2,1,1,1,1,1,1,1,1,1,1,1
1041 DATA 1,21,186,11,54,1,2,1,1,3,1,1,1,18
1042 DATA 186,12,1,1,47,1,5,1,1,1,2,23,184
1043 DATA 11,53,1,2,1,2,1,1,1,1,23,182,14
1044 DATA 54,1,1,1,1,2,1,24,180,13,53,1,4,1
1045 DATA 1,27,180,15,52,1,1,1,1,1,2,1,1,24
1046 DATA 181,12,55,1,2,1,1,26,181,14,55,1
1047 DATA 1,1,1,1,1,24,181,13,54,1,4,1,1,26
1048 DATA 180,2,1,11,54,1,1,1,1,1,1,1,1,24
1049 DATA 180,1,1,1,1,9,52,1,4,1,1,1,1,26
1050 DATA 181,13,52,1,1,1,1,1,1,1,1,1,1,24
1051 DATA 181,2,1,9,52,1,1,1,2,1,1,3,1,4,1
1052 DATA 19,181,10,1,3,50,1,2,1,1,1,1,2,1
1053 DATA 26,180,2,1,9,53,2,1,1,1,1,1,1,1,3
1054 DATA 1,21,181,14,52,1,2,1,1,1,1,1,1,2
1055 DATA 1,21,181,3,1,8,52,1,1,1,1,1,1,1,1
1056 DATA 1,1,1,1,1,1,12,1,9,180,2,1,1,1,3
1057 DATA 1,5,51,1,1,1,1,1,2,1,1,1,1,1,1,21
1058 DATA 181,1,1,1,1,4,1,3,1,1,50,1,3,1,1
1059 DATA 1,1,1,1,2,1,1,1,12,1,8,180,1,1,1
1060 DATA 1,4,1,3,1,1,1,1,56,1,2,1,1,1,1,21
1061 DATA 180,3,1,4,1,2,1,1,1,1,54,1,1,1,1
1062 DATA 1,1,1,1,12,1,10,181,1,1,5,2,1,1,1
1063 DATA 1,1,49,1,1,1,3,1,2,1,1,1,2,11,1
1064 DATA 10,179,2,1,4,1,1,1,1,1,1,1,1,55,1
1065 DATA 1,1,2,1,1,14,1,1,1,7,179,1,1,5,1
1066 DATA 2,1,1,2,1,1,1,2,1,52,1,6,23,177,1
1067 DATA 1,1,3,2,1,1,4,2,5,1,48,1,1,1,4,3
1068 DATA 1,11,1,10,178,4,2,1,1,1,1,1,3,1,2
1069 DATA 1,51,1,2,1,1,1,2,1,1,1,1,11,1,8
1070 DATA 179,1,1,1,1,2,2,1,4,2,56,1,3,1,1
1071 DATA 1,1,22,1,3,173,6,1,2,1,1,1,1,1,3
1072 DATA 61,1,1,1,1,1,1,11,1,12,171,4,1,1
1073 DATA 1,2,1,1,1,1,1,2,1,1,56,1,1,1,1,1
1074 DATA 1,1,1,1,1,25,170,1,1,5,1,6,2,1,1
1075 DATA 1,61,1,2,1,1,1,1,24,169,4,2,4,1,1
1076 DATA 2,3,57,1,2,1,4,1,1,1,1,25,169,5,1
1077 DATA 7,2,2,1,1,53,1,2,1,9,1,1,24,169,5
1078 DATA 1,3,1,2,1,3,2,1,54,1,9,1,1,26,169
1079 DATA 4,1,1,1,5,2,3,53,1,2,1,8,1,1,1,1
1080 DATA 2,1,22,169,4,2,6,1,3,1,1,3,5,1,1
1081 DATA 1,1,39,1,6,1,3,31,170,2,1,1,2,1,1
1082 DATA 4,1,2,5,1,1,7,1,1,42,1,1,3,2,3,1
1083 DATA 1,1,24,169,4,1,4,2,4,7,1,1,8,20,1
1084 DATA 14,1,1,1,1,3,1,2,1,2,1,1,1,28,170
1085 DATA 2,5,2,1,5,3,2,1,2,1,14,13,1,16,42
1086 DATA 169,3,1,1,2,1,1,6,4,1,1,1,2,1,1
1087 DATA 16,1,1,6,1,1,1,8,1,1,1,1,8,3,1,6
1088 DATA 27,171,2,2,1,3,1,1,5,5,2,6,2,10,4
1089 DATA 1,1,3,1,1,1,3,1,6,1,2,5,1,11,2,25
1090 DATA 171,2,1,1,1,1,1,2,1,2,1,2,4,1,11
1091 DATA 10,1,6,1,1,8,1,1,1,1,6,1,15,2,23
1092 DATA 172,15,4,1,3,2,3,1,1,1,1,10,1,6
1093 DATA 10,7,1,18,1,21,172,11,1,1,1,2,5,1
1094 DATA 1,2,2,18,1,2,10,15,1,13,1,20,173
1095 DATA 10,1,1,2,2,6,1,2,6,1,1,2,4,1,4,1
1096 DATA 3,11,5,1,4,1,2,1,5,1,8,1,19,173,9
1097 DATA 1,1,3,1,1,1,3,1,3,5,3,8,1,4,2,1,9
1098 DATA 1,1,9,3,36,174,5,2,3,4,1,1,1,3,1
1099 DATA 2,5,3,7,1,6,1,1,9,1,1,11,2,5,2,9
1100 DATA 1,18,174,4,4,1,5,1,4,1,2,2,9,3,2
1101 DATA 1,1,3,2,1,1,1,10,11,3,2,2,2,1,27
1102 DATA 175,5,2,2,1,1,3,1,6,2,14,1,1,1,1
1103 DATA 1,2,1,9,13,1,1,4,1,2,1,1,9,1,2,1
1104 DATA 14,173,6,3,1,1,1,4,1,18,2,1,1,1,1
1105 DATA 2,1,5,2,6,9,2,1,2,3,1,6,1,25,176
1106 DATA 4,2,1,1,1,4,2,2,1,21,1,3,1,1,2,9
1107 DATA 2,1,5,15,4,2,19,175,5,2,1,2,1,3,2
1108 DATA 1,1,2,1,17,3,2,1,2,1,9,1,1,3,1,4
1109 DATA 12,5,1,1,2,18,176,4,2,2,1,1,6,2,1
1110 DATA 1,18,2,4,2,10,3,2,6,11,1,1,3,1,4
1111 DATA 1,15,174,1,2,3,3,1,9,3,15,1,1,1,5
1112 DATA 1,1,1,8,11,1,1,1,1,6,1,1,2,1,1,3
1113 DATA 2,1,16,175,2,3,2,1,2,1,1,27,1,7,1
1114 DATA 10,9,1,1,1,1,1,1,1,2,1,1,1,1,1,1
1115 DATA 1,1,3,1,2,15,176,2,3,1,1,1,2,1,7
1116 DATA 1,37,10,2,1,3,1,12,1,1,17,177,1,3
1117 DATA 1,1,3,47,3,1,5,1,1,4,1,12,1,2,16
1118 DATA 176,1,3,1,2,2,2,1,28,1,15,9,1,1,1
1119 DATA 1,13,1,1,1,2,17,177,1,6,2,30,1,16
1120 DATA 4,1,5,2,1,12,1,1,1,2,17,182,1,1,2
1121 DATA 29,1,16,6,1,2,1,1,1,1,2,1,8,1,1,1
1122 DATA 3,18,177,1,6,3,28,1,17,6,1,2,1,1
1123 DATA 3,1,2,1,5,1,1,1,2,1,1,16,178,1,3
1124 DATA 1,1,1,1,1,1,1,43,8,2,3,1,1,6,1,1
1125 DATA 2,1,1,2,19,178,2,6,1,1,1,1,1,42,1
1126 DATA 1,7,2,1,1,1,1,1,4,1,2,1,2,1,1,1,1
1127 DATA 17,178,1,5,3,1,1,3,1,6,1,14,1,18
1128 DATA 1,1,9,3,1,3,1,2,1,3,1,1,1,1,18
1129 DATA 179,2,5,2,1,2,2,1,1,1,22,1,17,8,1
1130 DATA 1,10,2,1,1,1,1,1,16,180,1,2,1,2,1
1131 DATA 1,1,1,1,3,1,1,1,21,1,16,10,1,1,1
1132 DATA 1,4,1,1,2,1,2,1,1,1,17,181,1,3,1
1133 DATA 1,1,2,2,3,1,1,1,1,1,15,1,20,8,1,1
1134 DATA 1,1,1,2,2,1,2,1,1,5,1,15,183,1,2
1135 DATA 1,1,1,1,3,1,2,3,1,2,1,14,1,17,11
1136 DATA 1,1,1,1,2,1,2,1,1,1,1,1,1,2,1,16
1137 DATA 183,1,4,1,2,2,2,3,1,2,35,10,1,1,1
1138 DATA 1,2,1,1,1,2,1,1,1,1,19,185,1,2,1
1139 DATA 1,1,1,2,1,1,2,1,2,1,33,6,1,5,1,1
1140 DATA 2,1,3,1,1,1,1,18,1,1,188,1,2,1,1
1141 DATA 2,1,2,1,1,2,1,2,1,14,1,16,12,1,1
1142 DATA 1,1,4,1,1,1,2,16,190,1,1,3,1,2,2
1143 DATA 1,1,1,1,1,33,13,1,1,4,1,1,1,1,1,1
1144 DATA 16,195,1,1,1,1,1,1,1,1,1,1,1,16,1
1145 DATA 18,13,1,1,2,1,1,1,1,2,1,16,193,1
1146 DATA 2,1,1,1,1,1,2,1,1,1,14,1,18,12,1
1147 DATA 1,2,1,2,1,1,2,1,16,192,1,2,1,1,1
1148 DATA 1,1,1,1,1,1,2,1,14,1,6,1,11,13,1
1149 DATA 1,1,1,1,1,1,1,1,1,1,16,191,1,2,1
1150 DATA 1,1,2,1,2,1,1,1,2,1,11,1,9,1,9,13
1151 DATA 1,1,1,1,2,1,1,20,191,1,6,1,1,1,1
1152 DATA 1,1,1,1,2,11,1,20,14,1,1,1,1,1,1
1153 DATA 2,18,191,1,2,2,2,1,1,1,1,1,2,1,32
1154 DATA 1,1,13,1,1,1,1,1,1,1,20,197,1,1,1
1155 DATA 3,1,1,1,1,1,28,1,1,18,1,3,2,11,1
1156 DATA 6,192,1,5,1,2,1,3,1,1,1,22,3,3,1
1157 DATA 1,15,1,2,2,3,1,18,193,1,1,1,2,1,1
1158 DATA 1,4,1,1,1,20,1,1,1,1,2,1,1,1,20,3
1159 DATA 2,1,5,1,11,197,1,1,1,4,1,1,1,12,1
1160 DATA 6,1,3,3,1,4,1,16,1,3,1,2,1,6,1,9
1161 DATA 194,2,1,1,2,1,4,1,1,1,2,1,16,2,3
1162 DATA 2,1,1,1,2,1,20,1,2,1,7,1,8,197,1
1163 DATA 1,1,2,1,4,1,7,1,2,2,1,3,2,1,1,1,1
1164 DATA 1,2,1,1,3,1,2,1,12,1,7,1,6,1,10
1165 DATA 199,1,2,1,5,1,7,1,1,1,3,1,2,1,2,1
1166 DATA 2,1,2,1,1,5,1,20,1,7,1,9,195,1,1
1167 DATA 1,1,1,6,1,3,1,3,1,2,1,1,3,2,1,2,2
1168 DATA 1,1,1,2,1,7,1,16,1,4,1,15,196,2,1
1169 DATA 1,6,1,4,1,2,1,2,1,1,4,1,1,3,2,1,2
1170 DATA 1,1,1,6,1,25,1,11,199,1,4,1,2,1,1
1171 DATA 1,5,2,1,1,1,1,1,3,1,3,1,2,1,2,1,4
1172 DATA 1,1,1,17,1,4,1,3,1,9,201,1,3,1,4
1173 DATA 1,1,1,3,6,1,3,2,1,1,1,1,2,2,1,1,2
1174 DATA 1,2,1,17,1,1,1,2,1,2,1,2,1,7,199
1175 DATA 2,10,1,2,7,1,2,1,1,1,1,1,3,2,1,1
1176 DATA 2,1,2,1,20,1,3,1,2,1,10,200,1,1,1
1177 DATA 5,1,2,1,1,1,2,1,1,44,2,3,1,2,1,9
1178 DATA 200,1,3,1,2,1,1,1,3,1,1,1,1,10,1
1179 DATA 1,1,1,1,1,1,3,1,5,1,17,1,2,1,1,1
1180 DATA 12,202,1,1,1,3,1,1,1,4,2,1,6,3,1
1181 DATA 16,1,2,15,2,3,1,1,1,10,207,1,1,1
1182 DATA 2,1,2,1,1,6,2,1,17,1,1,4,1,13,1,2
1183 DATA 1,3,1,9,203,2,7,1,1,1,2,6,26,1,1
1184 DATA 12,1,6,1,8,206,1,1,1,2,2,4,6,2,1
1185 DATA 23,12,2,3,1,13,206,1,3,3,1,3,1,5
1186 DATA 2,1,14,1,2,4,2,1,1,10,1,1,1,16
1187 DATA 209,1,3,1,1,1,1,5,12,1,1,3,1,1,1
1188 DATA 1,2,1,1,1,1,1,1,2,1,8,1,1,1,15
1189 DATA 206,2,1,1,1,2,1,2,1,5,1,2,1,1,2,1
1190 DATA 4,1,2,2,2,1,1,2,1,2,1,11,1,2,1,17
1191 DATA 207,1,1,7,1,3,1,1,4,1,2,2,1,1,1,3
1192 DATA 1,22,1,19,205,1,2,5,1,1,1,4,3,1,3
1193 DATA 1,3,1,1,1,1,2,1,1,1,7,1,10,1,1,2
1194 DATA 1,1,7,1,9,206,4,1,1,1,3,1,1,1,1,1
1195 DATA 1,5,1,1,3,1,4,1,2,1,1,1,1,1,13,1
1196 DATA 2,1,18,208,2,4,1,1,2,1,1,1,1,10,5
1197 DATA 1,2,1,1,1,1,1,13,2,20,204,1,1,1,1
1198 DATA 5,1,4,1,1,12,2,1,2,1,13,1,2,1,1,1
1199 DATA 2,2,20,204,1,3,2,2,2,1,1,2,2,1,1
1200 DATA 9,1,3,1,2,1,1,1,1,2,1,6,1,3,1,1,1
1201 DATA 1,1,21,203,1,5,3,1,1,1,2,2,2,2,1
1202 DATA 8,1,8,1,1,1,1,4,1,1,1,4,1,1,1,22
1203 DATA 202,3,3,1,2,1,1,1,1,3,1,1,2,1,16
1204 DATA 1,1,3,1,1,1,3,3,4,1,24,201,2,5,4
1205 DATA 1,1,1,1,1,1,3,2,14,1,1,1,1,3,1,1
1206 DATA 2,1,4,28,200,4,1,2,1,4,2,1,1,1,1
1207 DATA 1,2,2,5,1,4,1,2,2,1,4,1,2,1,1,2,1
1208 DATA 1,28,200,4,2,2,2,1,3,2,1,1,1,3,5
1209 DATA 2,1,1,1,1,2,1,1,7,2,1,2,1,1,31
1210 DATA 199,4,2,4,1,4,5,1,3,2,2,1,1,3,2,1
1211 DATA 1,7,1,1,1,1,1,34,196,1,1,1,1,2,2
1212 DATA 1,1,1,1,1,7,1,3,1,1,1,1,1,1,2,1,2
1213 DATA 1,3,1,2,1,3,1,1,1,1,1,34,1,1,194
1214 DATA 1,1,4,2,2,1,1,3,1,4,1,1,1,2,1,1,1
1215 DATA 1,2,1,7,1,1,1,1,1,3,1,43,188,2,1
1216 DATA 1,1,3,1,1,1,1,3,1,4,1,1,2,1,1,1,2
1217 DATA 1,1,1,5,1,2,1,2,1,2,1,1,1,45,186
1218 DATA 3,1,1,1,4,1,2,9,2,1,2,1,1,1,2,1,1
1219 DATA 1,2,1,3,1,1,2,2,1,48,184,2,1,1,1
1220 DATA 1,2,3,1,1,2,1,2,2,2,1,1,1,1,1,1,2
1221 DATA 1,2,3,4,2,3,1,1,1,49,183,2,1,1,1
1222 DATA 2,2,2,1,3,2,1,2,1,2,1,1,2,1,1,1,2
1223 DATA 4,4,1,1,1,4,2,52,179,3,1,1,1,1,1
1224 DATA 1,1,3,1,2,2,1,2,1,1,1,1,6,6,4,1,2
1225 DATA 1,59,176,4,1,1,1,1,1,1,1,5,1,1,1
1226 DATA 1,1,4,1,1,3,1,6,6,1,64,172,3,3,1
1227 DATA 2,1,1,6,1,1,2,1,1,1,7,2,4,73,170
1228 DATA 4,1,1,1,1,2,1,2,7,1,2,10,2,2,75
1229 DATA 168,4,1,1,2,1,1,1,1,1,1,8,13,1,1
1230 DATA 77,164,8,2,1,1,1,1,1,2,6,17,78
1231 DATA 161,10,3,1,2,1,1,1,1,4,16,80,157
1232 DATA 14,4,1,2,1,1,4,18,80,153,18,3,1,1
1233 DATA 1,1,1,1,2,2,1,16,79,152,21,2,1,2
1234 DATA 1,1,3,19,78,151,24,3,1,1,1,1,2,20
1235 DATA 76,150,28,4,3,20,75,147,33,1,2,1
1236 DATA 2,20,74,145,37,4,1,20,73,143,37,7
1237 DATA 1,20,72,142,38,8,1,21,70,140,39
1238 DATA 10,1,15,1,2,1,2,69,137,41,12,1,15
1239 DATA 1,3,1,1,68,135,44,11,1,16,1,1,1,1
1240 DATA 69,133,45,14,1,14,1,1,1,2,68,131
1241 DATA 47,30,2,1,69,130,49,27,1,1,2,2,68
1242 DATA 128,51,28,2,1,1,1,68,126,53,27,1
1243 DATA 1,2,1,69,125,55,25,1,1,1,1,6,1,64
1244 DATA 123,57,26,2,1,7,1,63,121,56,15,1
1245 DATA 11,2,1,1,1,7,2,62,119,57,18,1,10
1246 DATA 1,1,1,1,8,2,61,117,58,4,3,13,1,8
1247 DATA 1,1,1,1,3,1,68,115,60,2,1,4,1,12
1248 DATA 1,1,1,3,1,2,1,1,1,2,9,1,61,113,62
1249 DATA 1,1,17,1,1,1,5,1,2,1,1,1,1,10,1
1250 DATA 60,112,62,1,1,20,1,1,1,1,1,2,1,1
1251 DATA 1,1,1,1,71,110,64,19,1,1,1,1,1,3
1252 DATA 1,3,1,1,1,1,71,109,65,19,1,1,1,1
1253 DATA 1,1,1,2,2,1,1,1,1,1,1,1,69,109,65
1254 DATA 19,1,1,1,3,1,1,1,1,1,1,1,1,1,1,71
1255 DATA 109,65,19,1,1,1,1,1,1,1,1,3,1,1,1
1256 DATA 2,1,70,55

27
samples/sample.moire.txt Normal file
View File

@ -0,0 +1,27 @@
8200 HGR
8210 W = 279 : H = 159
8220 FOR I = 0 TO 1 STEP 0.01
8230 HCOLOR= 1 : HPLOT 0,H * I TO W* (1-I),0
8232 HCOLOR= 6 : HPLOT W,H * I TO W * I,0
8233 HCOLOR= 2 : HPLOT W,H * (1-I) TO W * I,H
8234 NEXT
8310 W = 200 : H = 50
8320 FOR I = 0 TO 1 STEP 0.01
8330 HCOLOR= 1 : HPLOT 40,H * I TO W* (1-I),40
8332 HCOLOR= 6 : HPLOT W,H * I TO H * I,0
8333 HCOLOR= 3 : HPLOT W,H * (1-I) TO W * I,H
8334 NEXT
8410 W = 230 : H = 100
8420 FOR I = 0 TO 1 STEP 0.01
8230 HCOLOR= 1 : HPLOT 140,H * I TO W* (1-I),140
8432 HCOLOR= 6 : HPLOT W,H * I TO W * I,0
8433 HCOLOR= 3 : HPLOT W,H * (1-I) TO W * I,H
8434 NEXT

406
samples/sample.nuclear.txt Normal file
View File

@ -0,0 +1,406 @@
10 HOME
20 PRINT SPC( 8)"APPLE NUCLEAR POWER PLANT"
30 PRINT SPC( 9)"BY STEPHEN R. BERGGREN"
40 PRINT
50 PRINT "THIS PROGRAM SIMULATES THE OPERATION OF"
60 PRINT "A NUCLEAR POWER REACTOR. THE OBJECT"
70 PRINT "IS TO OPERATE THE PLANT AT A MAXIMUM"
80 PRINT "AVERAGE POWER OUTPUT WITHOUT CAUSING"
90 PRINT "A REACTOR MELTDOWN."
100 PRINT
110 PRINT "THE CONTROL RODS ADJUST THE AMOUNT OF"
120 PRINT "HEAT PRODUCED BY THE REACTOR. PRIMARY"
130 PRINT "COOLANT TRANSFERS THIS HEAT TO THE HEAT"
140 PRINT "EXCHANGER. SECONDARY COOLANT TRANSFERS"
150 PRINT "HEAT FROM THE HEAT EXCHANGER TO THE"
160 PRINT "TURBINE, WHERE POWER IS PRODUCED, AND"
170 PRINT "FINALLY TO THE COOLING TOWER. THE"
180 PRINT "EMERGENCY COOLANT IS USED TO HELP SHUT"
190 PRINT "DOWN THE REACTOR WHEN OTHER SYSTEMS"
200 PRINT "FAIL. UNLIKE THE OTHER COOLANTS, "
210 PRINT "EMERGENCY COOLANT IS NOT RECYCLED."
220 PRINT : INPUT "ENTER 'D' TO SEE REACTOR DIAGRAM ENTER 'I' FOR WORKING INSTRUCTIONS ENTER 'S' TO START OPERATION ";A$
221 IF A$ = "D" THEN GOSUB 6000: GOTO 220
222 IF A$ = "S" THEN 390
225 TEXT : HOME
230 PRINT "THE CONTROLS ARE OPERATED BY TYPING IN"
235 PRINT "THE DESIRED CONTROL ROD SETTINGS AND"
240 PRINT "FLOW RATES.(USE VALUES FROM 0 TO 100)"
245 PRINT "IF NO ENTRY IS MADE, THE VALUES WILL"
250 PRINT "NOT CHANGE. USE THE SPACE BAR TO STEP"
255 PRINT "TO THE DIFFERENT FUNCTIONS. WHEN THE"
260 PRINT "DESIRED ENTRIES HAVE BEEN MADE, USE THE"
265 PRINT "'RETURN' KEY TO ADVANCE TO THE NEXT DAY."
270 PRINT "THE REACTOR CAN BE OPERATED UNTIL A"
275 PRINT "MELTDOWN OCCURS OR THE REACTOR FUEL IS"
280 PRINT "EXHAUSTED. THE FUEL WILL LAST FOR"
285 PRINT "ABOUT 100 TO 150 DAYS. WHEN THE FUEL"
290 PRINT "IS EXHAUSTED, YOUR PERFORMANCE WILL BE"
295 PRINT "EVALUATED.
298 PRINT : INPUT " (PRESS RETURN TO CONTINUE)";A$: HOME
300 PRINT : PRINT "IF YOU WANT TO REPAIR DAMAGE OR REPLACE"
305 PRINT "COOLANT, BRING THE REACTOR TEMPERATURE"
310 PRINT "DOWN BELOW 100 AND SHUT OFF THE COOLANT"
315 PRINT "FLOWS. THIS WILL CAUSE AN AUTOMATIC"
320 PRINT "MAINTENANCE SHUTDOWN AND ALL COOLANT"
325 PRINT "WILL BE REPLENISHED AND REPAIRS MADE."
330 PRINT "THE GREATER THE DAMAGE, THE LONGER THE"
335 PRINT "REPAIRS WILL TAKE."
340 PRINT
350 PRINT " WARNING: THIS POWER PLANT HAS"
360 PRINT " NO AUTOMATIC SAFETY DEVICES!!"
370 PRINT
380 GOTO 220
390 REM INITIATE
400 GOSUB 2000
410 RH = 0
420 RL = 0
430 DAY% = 0
440 TT = 0
450 DMGE% = 0
455 A% = 0:A1% = 0:A2% = 0
460 REM WRITE REPORT
470 TEXT : HOME
475 DAY% = DAY% + 1
480 PRINT SPC( 7)"APPLE NUCLEAR POWER PLANT"
490 PRINT SPC( 8)"STATUS REPORT - DAY ";DAY%
500 PRINT
510 PRINT "WARNINGS:"
520 IF RT% > 800 THEN PRINT " REACTOR OVERHEATED":RD% = RD% + 1 + (RT% > 850) + (RT% > 900) + 2 * (RT% > 950):PD% = PD% + 1:ED% = ED% + 1 + (RT% > 850)
530 IF XT% > 500 THEN PRINT " HEAT EXCHANGER OVERHEATED":XD% = XD% + 1 + (XT% > 600):PD% = PD% + 1:SD% = SD% + 1
540 IF GO% > 2000 THEN PRINT " TURBINE OVERLOADED":TD% = TD% + 1 + (GO% > 2500 ):SD% = SD% + 1
550 IF CT% > 300 THEN PRINT " COOLING TOWER OVERHEATED":SD% = SD% + 1
560 IF GO% < 1000 THEN PRINT " POWER OUTPUT LOW"
570 IF EV% < 200 THEN PRINT " EMERGENCY COOLANT LOW"
580 IF PV% < 100 THEN PRINT " PRIMARY COOLANT LOW":PD% = PD% + 1
590 IF SV% < 100 THEN PRINT " SECONDARY COOLANT LOW":SD% = SD% + 1
600 PRINT
610 PRINT "DAMAGE:"
620 IF RD% > 3 THEN PRINT " REACTOR CORE DAMAGED"
630 IF PD% > 4 THEN PRINT " PRIMARY COOLANT LEAK - ";PD%;"/DAY":PV% = (PV% - PD%) * ((PV% - PD%) > 0)
640 IF SD% > 4 THEN PRINT " SECONDARY COOLANT LEAK - ";SD%;"/DAY":SV% = (SV% - SD%) * ((SV% - SD%) > 0)
650 IF ED% > 2 THEN PRINT " EMERGENCY COOLANT LEAK - ";2 * ED%;"/DAY":EV% = (EV% - 2 * ED%) * ((EV% - 2 * ED%) > 0)
660 IF PB% THEN PRINT " PRIMARY COOLANT PUMP FAILURE -";10 * PD% * (PD% < 10) + 100 * (PD% > = 10);"%"
670 IF SB% THEN PRINT " SECONDARY COOLANT PUMP FAILURE - ";10 * SD% * (SD% < 10) + 100 * (SD% > = 10);"%"
680 IF XB% THEN PRINT " HEAT EXCHANGER FAILURE"
690 IF GB% THEN PRINT " TURBINE FAILURE"
700 PRINT
710 IF RD% > 5 THEN PRINT " MELTDOWN! MELTDOWN! MELTDOWN!":GOTO 3000
720 PRINT "INDICATORS:"
730 PRINT " REACTOR TEMP. (MAX 800) ";RT%
740 PRINT " HEAT EXCHANGER TEMP. (MAX 500) ";XT%
750 PRINT " COOLING TOWER TEMP. (MAX 300) ";CT%
760 PRINT " POWER OUTPUT (MAX 2000KW) ";GO%;"KW"
765 KW% = TT / DAY%
770 PRINT " AVERAGE POWER OUTPUT ";KW%;"KW/DAY"
800 PRINT " CONTROL RODS- ";A%
810 PRINT " COOLANTS"
820 PRINT " EMERGENCY LEVEL- ";EV%;" FLOW- ";EF%
830 PRINT " PRIMARY LEVEL- ";PV%;" FLOW- "PF%
840 PRINT " SECONDARY LEVEL- ";SV%;" FLOW- "SF%;
850 IF (100 - RL) < 5 THEN PRINT : PRINT : PRINT "REACTOR FUEL EXHAUSTED": GOTO 4000
900 REM GET NEW CONTROL VALUES
910 P = PEEK (37)
920 VTAB (P - 3)
930 HTAB (20)
950 A2% = A1%:A1% = A%
955 B$ = "": FOR I = 1 TO 4
960 GET A$:Z = ASC (A$)
965 IF (Z < > 13 AND Z < > 32) AND (Z > 57 OR Z < 48) THEN 960
970 B$ = B$ + A$: IF Z = 13 THEN 1170
975 IF Z = 32 THEN 990
980 A% = VAL (B$):A% = A% + (100 - A%) * (A% > 100)
985 PRINT A$;: NEXT I
990 VTAB (P - 1)
1000 HTAB (35)
1005 B$ = "": FOR I = 1 TO 4
1010 GET A$:Z = ASC (A$)
1015 IF (Z < > 13 AND Z < > 32) AND (Z > 57 OR Z < 48) THEN 1010
1020 B$ = B$ + A$: IF Z = 13 THEN 1170
1025 IF Z = 32 THEN 1050
1030 EF% = VAL (B$):EF% = EF% + (100 - EF%) * (EF% > 100)
1035 IF EF% > EV% THEN EF% = EF%
1040 PRINT A$;: NEXT I
1050 VTAB (P)
1060 HTAB (35)
1065 B$ = "": FOR I = 1 TO 4
1070 GET A$:Z = ASC (A$)
1075 IF (Z < > 13 AND Z < > 32) AND (Z > 57 OR Z < 48) THEN 1070
1080 B$ = B$ + A$: IF Z = 13 THEN 1170
1085 IF Z = 32 THEN 1110
1090 PF% = VAL (B$):PF% = PF% + (100 - PF%) * (PF% > 100)
1100 PRINT A$;: NEXT I
1110 VTAB (P + 1)
1120 HTAB (35)
1125 B$ = "": FOR I = 1 TO 4
1130 GET A$:Z = ASC (A$)
1135 IF (Z < > 13 AND Z < > 32) AND (Z > 57 OR Z < 48) THEN 1130
1140 B$ = B$ + A$: IF Z = 13 THEN 1170
1145 IF Z = 32 THEN 1165
1150 SF% = VAL (B$):SF% = SF% + (100 - SF%) * (SF% > 100)
1160 PRINT A$;: NEXT I
1165 HTAB (1): VTAB (P - 3): CALL - 958: GOTO 800
1170 IF PF% = 0 AND SF% = 0 AND RH < 1 AND RT% < 100 AND A% = 0 THEN GOSUB 2000: HTAB (1): VTAB (24): CALL - 922: PRINT " MAINTENANCE SHUTDOWN - ";MD%;" DAYS": FOR I = 0 TO 5000: NEXT
1180 IF EF% > EV% THEN EF% = EV%
1200 REM DAMAGE ASSESSMENT AND OPERATION CALCULATIONS
1205 EV% = EV% - EF% - 2 * ED% * (ED% > 3)
1210 PD% = PD% + (PF% > 90) * ( RND (20) > .95)
1220 SD% = SD% + (SF% > 90) * ( RND (20) > .92)
1230 PB% = PD% > 5
1240 SB% = SD% > 5
1250 IF PF% > (100 - PD% * 10) AND PB% THEN PF% = (100 - PD% * 10) * (100 - PD% * 10 > 0)
1260 IF SF% > (100 - SD% * 10) AND SB% THEN SF% = (100 - SD% * 10) * (100 - SD% * 10 > 0)
1270 RL = RL + RH / 50
1280 RH = (A% * 30 + A1% * 60 + A2% * 10) / 2500 * (100 - RL)
1300 PH = PF% * (100 * (PV% > 100) + PV% * (PV% < = 100)) / 350
1310 EH = EF% / 200 * (RT% - 25)
1320 RT% = RT% + RH - EH - PH - 5 * (RT% > 25)
1325 RT% = 25 + (RT% - 25) * (RT% > 25)
1330 XT% = ((RT% - 25) * PF% + (CT% - 25) * SF%) / (PF% + SF% + 1) + 25
1340 IF XB% THEN XT% = RT% * .8 + 5
1350 SH = SF% * (100 * (PV% > 100) + PV% * (PV% < = 100)) / 350 * (XT% - CT%)
1360 IF XB% THEN SH = SH * .2
1370 GO% = SH / XT% * (XT% - CT%) * 2 / 3
1375 IF GO% > 2600 THEN GO% = 2600
1380 GO% = GO% * (GO% > 0) * (GB% = 0)
1390 CT% = 25 + ((XT% - 25) * (SH - GO%) / (SH + 1) * .75)
1400 IF XB% < 1 THEN XB% = (XD% > 2) * ( RND (4) > .9)
1410 IF GB% < 1 THEN GB% = (GD% > 4) * ( RND (4) > .9)
1420 TT = TT + GO%
1430 GOTO 470
2000 REM MAINTENANCE REPAIR SUBROUTINE
2010 EV% = 300
2020 PV% = 120
2030 SV% = 120
2040 RT% = 25
2050 XT% = 25
2060 CT% = 25
2070 DMGE% = DMGE% + 2 * RD% + ED% + PD% + XD% + SD% + GD%
2080 MD% = 5 + 3 * (10 * (RD% > 3) + (ED% > 3) + (PD% > 3) + (SD% > 3) + 2 * PB% + 2 * SB% + 3 * XB% + 3 * GB%):DAY% = DAY% + MD%
2090 RD% = 0
2100 ED% = 0
2110 PD% = 0
2120 XD% = 0
2130 SD% = 0
2140 GD% = 0
2150 PB% = 0
2160 SB% = 0
2170 XB% = 0
2180 GB% = 0
2190 EF% = 0:PF% = 0:SF% = 0
2195 GO% = 0
2200 RETURN
3000 REM MELTDOWN ENDING
3010 PRINT
3020 IF RD% > 6 THEN 3100
3030 PRINT "THE REACTOR CORE HAS BEEN DISTROYED BY"
3040 PRINT "UNCONTROLLED THERMAL RUNAWAY. HOWEVER,"
3050 PRINT "THE CONTAINMENT BUILDING HAS NOT YET"
3060 PRINT "RUPTURED.
3070 PRINT
3080 PRINT "INITIATE YOUR EVACUATION PLAN."
3090 GOTO 5000
3100 PRINT "THE REACTOR CORE HAS MELTED DOWN AND"
3110 PRINT "PRODUCED A STEAM EXPLOSION. THE"
3120 PRINT "CONTAINMENT BUILDING HAS RUPTURED."
3130 PRINT "LETHAL RADIOACTIVE GASES AND DEBRIS"
3140 PRINT "HAVE ESCAPED."
3150 PRINT
3160 PRINT "INITIATE YOUR EVACUATION AND RADIATION"
3170 PRINT "CLEANUP PLANS AND GET MEDICAL"
3180 PRINT "ASSISTANCE."
3190 GOTO 5000
4000 REM EVALUATION OF GAME RESULTS
4010 PRINT
4020 PRINT "OVER A PERIOD OF ";DAY%;" DAYS, YOU HAVE"
4030 PRINT "PRODUCED AN AVERAGE POWER OUTPUT OF"
4040 PRINT KW%;" KILOWATTS PER DAY."
4050 AKW% = 1 + (KW% > 1000) + (KW% > 1200) + (KW% > 1500) + (KW > 1800)
4060 PRINT
4070 PRINT "YOUR AVERAGE POWER PRODUCTION RATE IS"
4080 ON AKW% GOTO 4090,4100,4110,4120,4140
4090 PRINT "HORRIBLE! FIND A LESS DEMANDING JOB.": GOTO 4200
4100 PRINT "WAY BELOW YOUR AREA'S POWER NEEDS.": GOTO 4200
4110 PRINT "ADEQUATE. YOU COULD DO BETTER.": GOTO 4200
4120 PRINT "EXCELLENT! POWER COSTS IN YOUR AREA"
4130 PRINT "WILL NOT BE INCREASED.": GOTO 4200
4140 PRINT "NEAR THE MAXIMUM! POWER COSTS IN YQUR"
4150 PRINT "AREA WILL DROP SIGNIFICANTLY."
4200 REM DAMAGE EVALUATION
4210 PRINT
4215 GOSUB 2000
4220 D% = 1 + (DMGE% > 10) + (DMGE% > 20) + (DMGE% > 30)
4230 PRINT "THE EQUIPMENT DAMAGE SUSTAINED DURING"
4240 PRINT "THIS PERIOD WAS ";
4250 ON D% GOTO 4260,4270,4280,4290
4260 PRINT "VERY LIGHT.": GOTO 5000
4270 PRINT "MODERATE.": GOTO 5000
4280 PRINT "HEAVY.": GOTO 5000
4290 PRINT "SEVERE."
5000 REM END
5010 PRINT
5020 PRINT "WOULD YOU LIKE TO TRY AGAIN? (Y OR N)";
5030 INPUT A$
5040 IF A$ = "" THEN 5030
5050 IF A$ = "Y" THEN GOSUB 2000: GOTO 390
5060 HOME
5070 END
5100 B$ = ""
5105 FOR I = 1 TO 4
5110 GET A$
5130 IF ASC (A$) < > 32 THEN 5140
5134 IF B$ = "" THEN RETURN
5136 OUT% = VAL (B$)
5138 RETURN
5140 IF ASC (A$) = 13 THEN POP : GOTO 1170
5150 B$ = B$ + A$
5160 PRINT A$;
5170 NEXT I
5180 RETURN
6000 GR : COLOR= 15: FOR I = 0 TO 39: HLIN 0,39 AT I: NEXT I
6005 DE = 6000
6010 HOME : VTAB 23
6020 PRINT " THIS IS THE REACTOR VESSEL"
6030 RESTORE
6035 COLOR= 1
6040 FOR I = 1 TO 29
6050 READ X1,X2,Y
6060 HLIN X1,X2 AT Y
6070 NEXT I
6080 DATA 7,9,6,15,17,6,6,18,7,5,19,8,5,7,9,17,19,9,5,6,10,18,19,10,5,6,11,18,19,11,5,6,12,18,19,12,5,6,13,18,19,13,5,6,14
6090 DATA 18,19,14,5,6,15,18,19,15,5,6,16,18,19,16,5,6,17,18,19,17,5,6,18,18,19,18,5,7,19,17,19,19,6,18,20,7,17,21,8,16,22
6100 COLOR= 0
6110 HLIN 13,14 AT 6
6120 COLOR= 12
6130 HLIN 14,15 AT 5
6140 HLIN 14,16 AT 4
6150 HLIN 15,16 AT 3
6160 FOR I = 1 TO DE: NEXT I
6170 VTAB 23
6180 PRINT " THIS IS THE REACTOR CORE "
6190 COLOR= 8
6200 FOR I = 9 TO 15
6210 VLIN 11,17 AT I
6220 NEXT I
6230 FOR I = 1 TO DE: NEXT I
6240 VTAB 23
6250 PRINT " THESE ARE THE CONTROL RODS "
6260 COLOR= 13
6270 VLIN 2,17 AT 11
6280 VLIN 2,17 AT 13
6290 FOR I = 1 TO DE: NEXT I
6300 VTAB 23
6310 PRINT " THE EMERGENCY COOLANT CAN COOL THE"
6320 PRINT " REACTOR IN AN EMERGENCY."
6330 COLOR= 2
6340 FOR I = 1 TO 36
6350 READ Y,X
6360 PLOT X,Y
6370 FOR J = 1 TO 200: NEXT J
6380 NEXT I
6390 DATA 4,2,4,4,5,2,5,3,5,4,6,2,6,3,6,4,7,3,8,3,9,3,10,3,11,3,12,3,12,4,12,5,12,6,12,7,12,8,12,9
6400 DATA 13,9,14,9,15,9,16,9,16,8,16,7,16,6,16,5,16,4,16,3,17,3,18,3,19,3,20,3 ,22,3,24,3
6410 FOR I = 1 TO DE: NEXT I
6420 HOME : VTAB 23
6430 PRINT " THE PRIMARY COOLANT CARRIES HEAT FROM"
6440 PRINT " THE REACTOR CORE TO THE HEAT EXCHANGER"
6450 FOR I = 1 TO 52
6460 READ Y,X
6470 PLOT X,Y
6480 FOR J = 1 TO 200: NEXT J
6490 NEXT I
6500 FOR I = 1 TO DE: NEXT I
6510 DATA 4,25,4,27,5,25,5,26,5,27,6,25,6,26,6,27,7,26,8,26,9,26,10,26,11,26,12,26,12,25,12,24,12,23,12,22,12,21,12,20,12,19
6515 DATA 12,18,12,17,12,16,12,15,13,15,14,15,15,15,16,15,16,16,16,17,16,18
6520 DATA 16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,16,27,16,28,16,29,16,30,15,30,14,30,13,30,13,30,12,30,12,29,12,28,12,27
6540 HOME : VTAB 23
6550 PRINT " THIS IS THE HEAT EXCHANGER"
6560 COLOR= 5
6570 HLIN 28,34 AT 10
6580 VLIN 10,18 AT 34
6590 HLIN 28,34 AT 18
6600 VLIN 10,18 AT 28
6605 COLOR= 2: PLOT 28,12: PLOT 28,16: COLOR= 5
6610 FOR I = 1 TO DE: NEXT I
6620 VTAB 23
6630 PRINT " THIS IS THE GENERATOR TURBINE"
6640 HLIN 5,18 AT 30
6650 VLIN 30,36 AT 18
6660 HLIN 5,18 AT 36
6670 VLIN 30,36 AT 5
6680 COLOR= 0
6690 HLIN 2,17 AT 33
6700 FOR I = 7 TO 15 STEP 2
6710 PLOT I,34: PLOT I + 1,32
6720 NEXT I
6730 FOR I = 1 TO DE: NEXT I
6740 VTAB 23
6750 PRINT " THIS IS THE COOLING TOWER "
6760 COLOR= 5
6770 VLIN 23,25 AT 24
6780 VLIN 23,25 AT 36
6790 VLIN 25,26 AT 25
6800 VLIN 25,26 AT 35
6810 VLIN 26,28 AT 26
6820 VLIN 26,28 AT 34
6830 VLIN 28,36 AT 27
6840 VLIN 28,36 AT 33
6850 PLOT 34,36
6860 PLOT 26,36
6870 HLIN 25,35 AT 38
6880 FOR I = 1 TO DE: NEXT I
6890 VTAB 23
6900 PRINT " THE SECONDARY COOLANT CARRIES HEAT"
6910 PRINT " FROM THE HEAT EXCHANGER TO THE "
6920 PRINT " TURBINE AND THEN TO THE COOLING TOWER"
6925 COLOR= 2
6930 FOR I = 1 TO 123
6940 READ Y,X
6950 PLOT X,Y
6960 FOR J = 1 TO 200: NEXT J
6970 NEXT I
6980 DATA 4,35,4,37,5,35,5,36,5,37,6,35,6,36,6,37,7,36,8,36,9,36,10,36,11,36,12,36,12,35,12,34,12,33,12,32,13,32,14,32,15,32,16,32
6990 DATA 16,33,16,34,16,35,16,36,17,36,18,36,19,36,20,36,20,35,20,34,20,33,20,32,20,31,20,30,20,29,20,28,20,27,20,26,20,25,20,24,20,23,20,22,20,21
7000 DATA 21,21,22,21,23,21,24,21,25,21,26,21,27,21,27,20,27,19,27,18,27,17,27,16,27,15,27,14,27,13,27,12,27,11,27,10,27,9,27,8,27,7
7010 DATA 28,7,29,7,30,7,31,7,32,7,34,10,32,13,34,16,35,16,35,17,35,18,35,19,35,20,35,21,35,22,35,23,35,24,35,25,35,26,35,27,35,28
7020 DATA 34,28,34,29,34,30,35,30,35,31,35,32,34,32,34,33,34,34,34,35,34,36,34,37,34,38,33,38,32,38,31,38,30,38,29,38,28,38,27,38,26,38,25,38,24,38,23,38
7030 DATA 22,38,21,38,20,38,19,38,18,38,17,38,16,38,15,38,14,38,13,38,12,38,12,37
7040 HOME : VTAB 23
7060 RETURN
9000 REM VARIABLE PREFIXES
9010 REM A-CONTROL RODS, C-COOLING TOWER, E-EMERGENCY COOLANT, G-TURBINE, P-PRIMARY COOLANT, R-REACTOR, S-SECONDARY COOLANT, X-HEAT EXCHANGER
9020 REM VARIABLE SUFFIXES
9030 REM B-BROKEN, D-DAMAGE, F-FLOW RATE, H-HEAT FLOW, L-LIFE, O-OUTPUT, T-TEMPERATURE, V-VOLUME
9040 REM OTHER VARIABLES TOT-TOTAL POWER OUTPUT, KW-AVERAGE POWER OUTPUT, DAY-DAY OF OPERATION, DMGE-TOTAL EQUIPMENT DAMAGE
9050 REM PROGRAM DESCRIPTION BY LINE NUMBER
9060 REM 10-220 INTRODUCTION
9070 REM 225-380 INSTRUCTIONS
9080 REM 390-455 VARIABLE INITIATION
9090 REM 460-850 WRITE REPORT AND ASSESS DAMAGE
9100 REM 900-1165 INPUT NEW CONTROL VARIABLES
9110 REM 1170 MAINTENANCE SHUTDOWN EVALUATION
9120 REM 1200-1260 PUMP FAILURE ASSESSMENT
9130 REM 1270-1430 PLANT OPERATING ALGORITHMS
9140 REM 2000-2200 MAINTENANCE SHUTDOWN SUBROUTINE
9150 REM 3000-3190 MELTDOWN ENDING
9160 REM 4000-4290 EVALUATION OF GAME RESULTS
9170 REM 5000-5070 END
9180 REM 6000-7060 PLANT DIAGRAM SUBROUTINE
9190 REM 9000-9190 REMARKS
9200 REM APPLE NUCLEAR POWER PLANT
9210 REM BY STEPHEN R BERGGREN

View File

@ -0,0 +1,2 @@
1 HOME:FORG=1TO6:READG$(G):NEXT:FORQ=1TO16:FORI=1TO40:FORG=1TO6:VTABG+Q:HTABI:PRINTG$(G):NEXT:K=PEEK(49200):VTAB1:HTAB12:?"CHUGGA CHUGGA":NEXT:VTAB1:HTAB12:?" TOOT TOOT ":?CHR$(7):FORJ=1TO150:NEXT:?CHR$(7):NEXT
2 DATA " ( @"," /-\ @"," ! ( !-I!"," NIBBLE \_/ !:O!"," ------ ---- !--!\"," 0-00-0 0--0 0--0_\"

138
samples/sample.piglatin.txt Normal file
View File

@ -0,0 +1,138 @@
10 REM PIG LATIN TRANSLATOR
20 REM BY Gregg Buntin
30 REM OCT. 10, 1984
40 GOTO 140
50 REM THINGS TO WATCH FOR
60 CK$ = " .,;:><?/)(*&^%$#@!+={}[]1234567890"
70 REM VOWELS
80 CV$ = "AEIOU"
90 DIM X$(100)
100 RETURN
110 REM CENTER STRING ON SCREEN
120 HTAB (39 - LEN (A$)) / 2 + 1: PRINT A$: RETURN
130 REM BEGINING
140 TEXT : HOME :A$ = "PIG LATIN TRANSLATOR"
150 GOSUB 120:A$ = "BY Gregg Buntin": VTAB 2: GOSUB 120
160 REM KEEP TITLE ON PAGE
170 POKE 34,2: VTAB 6
180 REM DIRECTIONS
190 PRINT : PRINT : PRINT
200 HOME : VTAB 5: PRINT "THIS FUNCTION WILL CONVERT ANY SENTENCE"
210 PRINT "FROM ENGLISH TO PIG LATIN. BE SURE TO"
220 PRINT "TYPE THE WORDS IN CORRECTLY OR YOU MAY"
230 PRINT "GET GARBAGE SENTENCES. DO NOT USE ANY"
240 PRINT "COMMAS OR QUOTATION MARKS. WHEN READY"
250 PRINT "TO QUIT JUST TYPE 'FINISHED'. HAVE FUN!"
260 PRINT : PRINT : PRINT
270 REM GET SET TO START
280 VTAB 15:A$ = "PRESS RETURN TO CONTINUE": GOSUB 120
290 K = PEEK ( - 16384): IF K < > 141 THEN 290
300 POKE - 16368,0
310 REM GET SENTENCE
320 HOME : VTAB 10
330 PRINT : PRINT : PRINT
340 INPUT "ENGLISH SENTENCE :";ES$
350 IF ES$ = "" THEN 320
360 GOSUB 60
370 REM ARE THEY DONE?
380 IF ES$ = "FINISHED" THEN TEXT : HOME :A$ = "ATSTHA ALLA OLKSFA": GOSUB 120:A$ = "(THATS ALL FOLKS)": GOSUB 120: END
390 REM TRANSLATE THE SENTENCE
400 PRINT : PRINT : PRINT
410 HOME : FLASH :A$ = "TRANSLATING": VTAB 6: GOSUB 120: NORMAL
420 REM ISOLATE WORDS & GARBAGE
430 X = 1: FOR I = 1 TO LEN (ES$)
440 Q$ = MID$ (ES$,I,1): FOR J = 1 TO LEN (CK$): IF Q$ = MID$ (CK$,J,1) THEN X = X + 1:X$(X) = Q$: GOTO 460
450 GOTO 480
460 IF X$(X) = " " THEN X = X + 1
470 GOTO 500
480 NEXT J
490 X$(X) = X$(X) + Q$
500 NEXT I
510 REM CONVERT TO PIG LATIN
520 FOR I = 1 TO X: IF LEN (X$(I)) < 3 THEN 610
530 FOR J = 1 TO LEN (X$(I)): FOR K = 1 TO LEN (CV$)
540 IF MID$ (X$(I),J,1) = MID$ (CV$,K,1) THEN 560
550 NEXT K,J
560 IF J = 1 THEN X$(I) = X$(I) + "A": GOTO 610
570 IF J - 1 = > LEN (X$(I)) THEN X$(I) = X$(I) + "A": GOTO 610
580 T$ = LEFT$ (X$(I),J - 1)
590 T$ = RIGHT$ (X$(I), LEN (X$(I)) - (J - 1)) + T$ + "A"
600 X$(I) = T$
610 NEXT I
620 REM PRINT OUT RESULT
630 HOME : VTAB 6: PRINT "YOUR SENTENCE:": PRINT : PRINT ES$
640 PRINT : INVERSE : PRINT "PIG LATIN TRANSLATION:": NORMAL : PRINT : FOR I = 1 TO X: PRINT X$(I);: NEXT
650 REM GET SET FOR MORE
660 PRINT : PRINT : PRINT
670 VTAB 20:A$ = "PRESS RETURN TO CONTINUE": GOSUB 120
680 K = PEEK ( - 16384): IF K < > 141 THEN 680
690 POKE - 16368,0: CLEAR : PRINT : PRINT : PRINT : GOTO 320

View File

@ -0,0 +1,5 @@
0 GR:y=10:x=0
6 COLOR = int(RND(1) * 6) + 2
7 sp = int(20 + (10* sin(x* 3.14159 / 180 ) )) / 2
8 y=y + 1: IF y > 25 then y = 10
10 PLOT y,sp:x=x + 15:goto 6

View File

@ -0,0 +1,9 @@
990 print "ENTER A NUMBER AND SEE IF IT'S PRIME"
1000 input n
1002 if n<>int(n) then print "ENTER AN INTEGER":GOTO 1000
1004 if n<2 then print "ENTER AN INTEGER GREATER THAN 1":GOTO 1000
1010 for d=2 to n-1
1020 if n/d = int(n/d) then print "NOT PRIME; MULTIPLE OF "; d:GOTO 1000
1030 next d
1040 print n; " IS PRIME"
1050 goto 1000

View File

@ -0,0 +1,94 @@
101 count = 0
105 for i = 0 to 20
106 print
107 next i
110 Dim x2(7),sign(7), dx(7)
120 Rem Init some vars
125 aminerr=1000
130 rem res = 8.5e-17
132 res = 1e-4
200 xpi=3.14159265358979323846
250 rem 8 coefs here
255 Rem elementary charge (e)-0
260 x2(0)=1.60217662e-19
265 Rem Planck's constant (h)-1
300 x2(1)=6.62607004e-34
350 rem eletron mass (Me)-2
400 x2(2)=9.109383560899034e-31
450 Rem Proton radius (Rp)-3
500 x2(3)=8.41235640479985e-16
550 Rem Rydberg Constant (R_H or R_{\infty})-4
600 x2(4)=10973731.5685083
610 Rem Permittivity of free space (e0)-5
620 x2(5)=8.854187817e-12
701 Rem Speed of Light (c)-6
702 x2(6)=299792458.0
703 Rem Proton mass (Mp)-7
704 x2(7)=1.672621898209999e-27
710 For i = 0 to 6
720 sign(i)=0
730 dx(i) = 0.01*res*(x2(i))
740 next i
750 Rem define bit to be twiddled here
755 sign(0)=1
760 sign(1)=1
770 sign(2)=1
780 sign(3)=1
790 sign(4)=1
795 sign(5)=1
797 sign(6)=1
1000 rem starting error
1010 xerr1=x2(2)*x2(0)^4/(8*x2(6)*x2(5)^2*x2(1)^3*x2(4))
1015 yerr2=-xpi*x2(3)*x2(6)*x2(2)/(2*x2(1))
1017 err = xerr1 + yerr2 - 1.0
1020 digits=int(-log(abs(yerr+0.00001))/log(10)+0.5)
1030 Print "Starting err is: ";err
1032 Print "Starting xerr1 is: ";xerr1
1034 Print "Starting yerr2 is: ";yerr2
1040 print "Digits resolution ";digits
1050 print "aminerr error is: ";aminerr
1060 for i = 0 to 6
1061 print "i= ";i, x2(i)
1062 next i
1100 print "pi= ";xpi
1111 rem end
2000 Rem Main Loop
2010 For i = 0 to 6
2020 x2(i)=x2(i)+sign(i)*dx(i)
2030 xerr1=x2(2)*x2(0)^4/(8*x2(6)*x2(5)^2*x2(1)^3*x2(4))
2032 yerr2=-xpi*x2(3)*x2(6)*x2(2)/(2*x2(1))-1.0
2034 err=abs(xerr1+yerr2)
2035 if err>aminerr then sign(i)=-1*sign(i)
2037 if err<aminerr then aminerr = err
2040 next i
2050 if err < 1.5*res then goto 5000
2055 print "Working ";err
2058 count = count+1
2060 goto 2000
5000 Rem
5001 xresstop=2e-15
5002 if res > xresstop then res = res/10.0
5010 For i = 0 to 6
5030 dx(i) = 0.01*res*(x2(i))
5040 next i
5100 if res > xresstop then goto 2000
5106 Print "Done."
5107 print "Coef "
5109 for i = 0 to 7
5110 print x2(i);" "
5120 next i
6000 rem Final error
6010 xerr1=(x2(2)*x2(0)^4)/(8*x2(6)*x2(5)^2*x2(1)^3*x2(4))
6012 yerr2=-xpi*x2(3)*x2(6)*x2(2)/(2*x2(1)) - 1.0
6014 err=abs(xerr1+yerr2)
6020 digits=int(-log(abs(err+1e-16))/log(10)+0.5)
6030 Print "Starting err is: ";err
6040 print "Digits resolution ";digits
6050 print "Final error is: ";aminerr
6060 print "Iterations= ";count
6070 print xpi;" <-ideal"
6080 print xpi+err;" <-calc'd
6085 print "Calc'd proton mass= ";2*x2(1)/(xpi*x2(3)*x2(6))
6087 print "Input proton mass= ";x2(7)
6090 print "Proton/electron mass ratio=";x2(7)/x2(2)
6100 end

22
samples/sample.quine.txt Normal file
View File

@ -0,0 +1,22 @@
5 REM QUINE program
10 FOR i = 5 TO 55 STEP 5
15 READ a$
20 PRINT a$
25 NEXT i
30 RESTORE
35 FOR i = 105 TO 155 STEP 5
40 READ a$
45 PRINT i; " DATA "; a$
50 NEXT i
55 PRINT
105 DATA 5 REM QUINE program
110 DATA 10 FOR i = 5 TO 55 STEP 5
115 DATA 15 READ a$
120 DATA 20 PRINT a$
125 DATA 25 NEXT i
130 DATA 30 RESTORE
135 DATA 35 FOR i = 105 TO 155 STEP 5
140 DATA 40 READ a$
145 DATA 45 PRINT i; " DATA "; a$
150 DATA 50 NEXT i
155 DATA 55 PRINT

30
samples/sample.radar.txt Normal file
View File

@ -0,0 +1,30 @@
10 HGR2
13 R = 4.76
15 HCOLOR= 3
20 GOSUB 300
25 HCOLOR= 3
30 LX = 140 + 93 * COS (R)
40 LY = 96 + 93 * SIN (R)
45 HCOLOR= 3
48 GOSUB 200
49 FOR W = 1 TO 100
50 NEXT W
51 R = R + 0.02
52 SX = 140 + 93 * COS (R)
53 SY = 96 + 93 * SIN (R)
55 HCOLOR = 0
57 GOSUB 200
60 LX = SX
65 LY = SY
70 GOTO 45
200 HPLOT 140,96 TO LX,LY
210 RETURN
300 FOR D = 1 TO 30
310 CX = 140 + 95 * COS (C)
320 CY = 96 + 95 * SIN (C)
330 HPLOT CX,CY
335 C = C + 0.21
336 FOR Q = 1 TO 100
337 NEXT Q
340 NEXT D
350 RETURN

View File

@ -0,0 +1,106 @@
10 home : text
20 dim maze(39,39)
30 c=1 : d=1 : e=1 : f=1
40 htab(11) : vtab(4) : print "'AN UNFINISHED MAZE'"
50 htab(11) : vtab(5) : print "-------------------"
60 htab(5) : vtab(8) : print "* Programmed by Alexander G. Tozzi"
70 htab(5) : vtab(9) : print "* www.wumpustales.com"
80 htab(5) : vtab(10) : print "- - - - - - - - - - - - - - - - -"
90 flash : htab(9) : vtab(16) : print "(PRESS ANY KEY TO BEGIN)" : normal
100 key=peek(49152) : if key<128 then 100
110 poke 49168,0 : gr
140 gosub 1000
150 gosub 2000
160 gosub 3000
170 htab(1) : vtab(21) : print "A: UP"
180 htab(1) : vtab(22) : print "Z: DOWN"
190 htab(10) : vtab(21) : print "J: LEFT Q: QUIT"
200 htab(10) : vtab(22) : print "K: RIGHT"
210 goto 160
1000 for y=0 to 39
1100 for x=0 to 39
1200 read a : maze(x,y)=a
1300 next x : next y
1999 return
2000 for y=0 to 39
2100 for x=0 to 39
2200 a=maze(x,y)
2300 if a=1 then color=2 : plot x,y
2400 if a=0 then color=9 : plot x,y
2500 if a=2 then color=1 : plot x,y
2500 next x : next y
2999 return
3000 key=peek(49152) : if key<128 then key=128
3100 poke 49168,0
3200 button$=chr$(key-128)
3300 if key<>128 then gosub 7000
3400 if button$="A" then if maze(e,f-1)<>1 then f=f-1
3500 if button$="Z" then if maze(e,f+1)<>1 then f=f+1
3600 if button$="J" then if maze(e-1,f)<>1 then e=e-1
3700 if button$="K" then if maze(e+1,f)<>1 then e=e+1
3800 if button$="Q" then end
3900 if maze(e,f)=2 then gosub 8000
3950 color=15 : plot e,f
3999 return
7000 c=e : d=f
7100 color=9 : plot c,d
7999 return
8000 text : home
8100 htab(10) : vtab(5) : print "YOU ESCAPED MY MAZE!"
8200 htab(10) : vtab(6) : print "--------------------"
8300 htab(10) : vtab(10): print "NEXT TIME YOU WON'T"
8400 htab(14) : vtab(11) : PRINT "BE SO LUCKY!"
8500 htab(14) : vtab(12) : print "------------"
8400 flash
8500 htab(9) : vtab(16) : print "(PRESS ANY KEY TO END)"
8600 normal
8700 end
50000 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
50001 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1
50002 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1
50003 data 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1
50004 data 1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1
50005 data 1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,2,1,0,0,0,1,0,1
50006 data 1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,1,0,1
50007 data 1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1
50008 data 1,1,0,1,0,0,0,1,1,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,1,1,0,1
50009 data 1,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1
50010 data 1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,0,1,1,1
50011 data 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1,0,1
50012 data 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,1
50013 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,0,1
50014 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1
50015 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1
50016 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1
50017 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1
50018 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1
50019 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1
50020 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1
50021 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50022 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50023 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50024 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50025 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50026 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50027 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50028 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50029 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50030 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50031 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50032 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50033 data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
50034 data 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1
50035 data 1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1
50036 data 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1
50037 data 1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1
50038 data 1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1
50039 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

51
samples/sample.vdt.txt Normal file
View File

@ -0,0 +1,51 @@
10 PRINT "V,D,T"
20 INPUT "What do you want to solve? ( V,D,T,)"; A$
30 IF A$ = "V" THEN GOTO 60
40 IF A$ = "D" THEN GOTO 70
50 IF A$ = "T" THEN GOTO 80
60 PRINT " V= D/T"
61 PRINT "Distance=": INPUT D
62 PRINT "Time =":INPUT T
63 LET V = D/T
64 PRINT "Velocity ="
65 PRINT V
66 END
70 PRINT " D= V*T"
71 PRINT "Velocity=": INPUT V
72 PRINT "Time =":INPUT T
73 LET D = V*T
74 PRINT "Distance ="
75 PRINT D
76 END
80 PRINT " T= D/V"
81 PRINT "Distance=": INPUT D
82 PRINT "Velocity=":INPUT V
83 LET T = D/V
84 PRINT "Time ="
85 PRINT T
86 END