From 5ab3a2a833d0d804e38b7e30b338ca309b6c729e Mon Sep 17 00:00:00 2001 From: Jon Foster Date: Wed, 29 Sep 2021 22:06:20 -0700 Subject: [PATCH] Project cleanup * Removed BAS files from root into BAS-EXAMPLES * Moved Linux desktop app files into GUI * More ignores --- .gitignore | 1 + BAS-EXAMPLES/curve.bas | 2 + BAS-EXAMPLES/guess.bas | 2 + GUI/bwbasic.sh | 8 +- Makefile | 4 +- OME/Desktop/bwbasic.desktop | 12 -- abs.bas | 5 - bin-to-dec.bas | 24 ---- bwbasic.desktop | 12 -- bwbasic.png | Bin 3927 -> 0 bytes bwbasic.sh | 11 -- curve.bas | 14 -- dec-to-bin.bas | 14 -- guess.bas | 22 ---- ohmslaw.bas | 311 -------------------------------------------- profile.bas | 5 - tictac.bas | 174 ------------------------- 17 files changed, 13 insertions(+), 608 deletions(-) delete mode 100755 OME/Desktop/bwbasic.desktop delete mode 100644 abs.bas delete mode 100644 bin-to-dec.bas delete mode 100755 bwbasic.desktop delete mode 100755 bwbasic.png delete mode 100755 bwbasic.sh delete mode 100644 curve.bas delete mode 100644 dec-to-bin.bas delete mode 100644 guess.bas delete mode 100644 ohmslaw.bas delete mode 100644 profile.bas delete mode 100644 tictac.bas diff --git a/.gitignore b/.gitignore index 6eed6b3..ae4d078 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ editfl.bas *.geany *.orig *.rej +*~ diff --git a/BAS-EXAMPLES/curve.bas b/BAS-EXAMPLES/curve.bas index fa8aed9..a65cdac 100644 --- a/BAS-EXAMPLES/curve.bas +++ b/BAS-EXAMPLES/curve.bas @@ -1,3 +1,5 @@ + 50 rem 12/13/2019 Ken curve + 60 SHELL "cls" 100 REM PLOT A NORMAL DISTRIBUTION CURVE 120 DEF FNN(X) = EXP(-(X^2/2))/SQR(2*3.14159265) 140 FOR X = -2 TO 2 STEP .1 diff --git a/BAS-EXAMPLES/guess.bas b/BAS-EXAMPLES/guess.bas index 2fe6b8e..763ad8f 100644 --- a/BAS-EXAMPLES/guess.bas +++ b/BAS-EXAMPLES/guess.bas @@ -1,4 +1,6 @@ + 10 rem 12/13/2019 Ken guess a number game 100 REM GUESSING GAME + 110 SHELL "cls" 120 PRINT "GUESS THE NUMBER BETWEEN 1 AND 100." 140 LET X = INT(100*RND(0)+1) 150 LET N = 0 diff --git a/GUI/bwbasic.sh b/GUI/bwbasic.sh index 268b2c1..cdbdf67 100755 --- a/GUI/bwbasic.sh +++ b/GUI/bwbasic.sh @@ -1,7 +1,11 @@ +#!/bin/sh # 12/14/2019 Ken +# 07/28/2020 enhanced by ChipMaster +[ -z "$BWBASIC" ] && BWBASIC="$HOME/bwbasic" +[ ! -d "$BWBASIC" ] && mkdir "$BWBASIC" +cd "$BWBASIC" trap 'echo " "; echo "PROGRAM INTERRUPTED"; echo "Press Enter "; read j; exit 1' INT -cd /home/$USER/source/bwbasic-3.2a/BAS-EXAMPLES -bwbasic +bwbasic "$@" # -n = no newline -e interpret special octel numbers \007 = Bell /bin/echo -n -e "Bwbasic terminated. Press Enter \007" read j diff --git a/Makefile b/Makefile index 6743378..1eda5a8 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,11 @@ bwbasic: # bwbasic and renum runtime. editfl temp file created by renum clean: - rm -f *.o bwbasic renum editfl core + rm *.o bwbasic renum editfl core || true install: ls -l bwbasic renum - cp bwbasic renum bwbasic.sh $(DEST)/. + cp bwbasic renum GUI/bwbasic.sh $(DEST)/. ls -l $(DEST)/bwbasic $(DEST)/renum $(DEST)/bwbasic.sh mkdir -p /usr/share/bwbasic mkdir -p /usr/share/doc/cbwbasic diff --git a/OME/Desktop/bwbasic.desktop b/OME/Desktop/bwbasic.desktop deleted file mode 100755 index 1c81de9..0000000 --- a/OME/Desktop/bwbasic.desktop +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Encoding=UTF-8 -Name=Bywater BASIC -GenericName=Bywater BASIC -Type=Application -Exec=/usr/bin/bwbasic.sh -Icon=/usr/share/pixmaps/bwbasic.png -StartupNotify=true -Terminal=true -Categories=Development - diff --git a/abs.bas b/abs.bas deleted file mode 100644 index e5267e5..0000000 --- a/abs.bas +++ /dev/null @@ -1,5 +0,0 @@ -100 rem ABS.BAS -- Test ABS() function -110 X = -1.23456789 -120 ABSX = ABS( X ) -130 print "The absolute value of "; X; " is"; ABSX -140 print "Is that correct?" diff --git a/bin-to-dec.bas b/bin-to-dec.bas deleted file mode 100644 index 9d016b7..0000000 --- a/bin-to-dec.bas +++ /dev/null @@ -1,24 +0,0 @@ - 10 CALL SHELL("cls") - 100 LET P = 0 - : LET S = 0 - 110 INPUT "Enter binary number: ";N$ - 120 L = LEN (N$) - : IF L=0 GOTO 300 - 130 FOR I=1 TO L - 135 IF (N$ = "0") GOTO 1000 - 140 LET B$ = MID$(N$, L-I+1, 1) - 150 IF NOT (B$ = "0" OR B$ = "1") GOTO 300 - 160 LET K = VAL(B$) - 170 IF (K > 0) THEN - : S = S + 2 ^ P - : END IF - 180 LET P = P + 1 - 190 NEXT - 200 GOTO 310 - 300 PRINT "Error, invalid binary entered" - : GOTO 100 - 310 PRINT - 315 PRINT "Equals decimal ";S - 320 PRINT - 1000 END - diff --git a/bwbasic.desktop b/bwbasic.desktop deleted file mode 100755 index 1c81de9..0000000 --- a/bwbasic.desktop +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Encoding=UTF-8 -Name=Bywater BASIC -GenericName=Bywater BASIC -Type=Application -Exec=/usr/bin/bwbasic.sh -Icon=/usr/share/pixmaps/bwbasic.png -StartupNotify=true -Terminal=true -Categories=Development - diff --git a/bwbasic.png b/bwbasic.png deleted file mode 100755 index 9745723b4a37491d4ae69ed0b26e0bada9cad70c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3927 zcmV-d52)~oP)q`?Ti8NKgzQTtwZD2*^|pKO z{BgB9Vn%V9bLRI)ojR}Tz4v*)-}kpYNGS#XpA3D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qeB+IhhZg;s{>FMd|>FG|V(`K{Dvdr`R z7Yhv`gaJjP(P%VknkIzs!i5V@KKbOG)9=ljc`pY5;2;kWZYj~S|T2&rbQ4K zKW+>L=8>|)hsySC-MTd`EiI8q5JKE;cV=cL&-1Lmre-5alI(Un<8V5icDr2^MM;tn zLNGN)vtcNaNGOUDkH>Xgw=Ao!u5Rnrt+Vs)n>KYWfRF=}0Dve@0d4PW!xpBHq`RFI z=;zLz`=qLL%a$$a>FKdp3_@tP+XoID=yJL2b~~HYWLXwPk?onxB}_x?pdbj4EfOgv zw%;U^Nfx+hG^*=*eSQ7YPd}YE?VcGk=2OhpNDz)he7+8W6S7ARLlA%TQR%r0m5)5~ zh{xlhl*+Qqaz_vZx7*Ev;&3<^7E2~U5K<0fqY{fOyx|QM)1a>Fi9{kC4l9bHXi}s#H@)ecn2JWphmhE~Rlz z(-cKvs;aB2d;Iao?_Kb~;)11uC@9g${sSc^KPxLJD9Fyv&dkhYzG2Q_Cd;zZ>10}w zWtqt~6&*(NExUc+*jbjvW`0f6qS0s~kvMtsNDjM2w^Hl-|U#1 z0_s;)rfC|6p=lb%IJFwEHkYa~tS+b0=O$5Z7AS?qx*l8BQvH$vrRoa%ev{GpK|nV| l5M!L0>=?ui_3eAx{{UN7(&yp9p11%2002ovPDHLkV1kC0m^lCd diff --git a/bwbasic.sh b/bwbasic.sh deleted file mode 100755 index cdbdf67..0000000 --- a/bwbasic.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# 12/14/2019 Ken -# 07/28/2020 enhanced by ChipMaster -[ -z "$BWBASIC" ] && BWBASIC="$HOME/bwbasic" -[ ! -d "$BWBASIC" ] && mkdir "$BWBASIC" -cd "$BWBASIC" -trap 'echo " "; echo "PROGRAM INTERRUPTED"; echo "Press Enter "; read j; exit 1' INT -bwbasic "$@" -# -n = no newline -e interpret special octel numbers \007 = Bell -/bin/echo -n -e "Bwbasic terminated. Press Enter \007" -read j diff --git a/curve.bas b/curve.bas deleted file mode 100644 index a65cdac..0000000 --- a/curve.bas +++ /dev/null @@ -1,14 +0,0 @@ - 50 rem 12/13/2019 Ken curve - 60 SHELL "cls" - 100 REM PLOT A NORMAL DISTRIBUTION CURVE - 120 DEF FNN(X) = EXP(-(X^2/2))/SQR(2*3.14159265) - 140 FOR X = -2 TO 2 STEP .1 - 150 LET Y = FNN(X) - 160 LET Y = INT(100*Y) - 170 FOR Z = 1 TO Y - 180 PRINT " "; - 190 NEXT Z - 200 PRINT "*" - 210 NEXT X - 220 END - diff --git a/dec-to-bin.bas b/dec-to-bin.bas deleted file mode 100644 index deab180..0000000 --- a/dec-to-bin.bas +++ /dev/null @@ -1,14 +0,0 @@ - 5 REM input a number, output its binary representation - 10 CALL SHELL("cls") - 50 INPUT "Enter an integer greater than zero : ";A - 60 IF (A < 0 OR A<>INT(A)) GOTO 50 - 65 IF (A = 0) GOTO 140 - 70 LET B = A - INT (A/2) * 2 - 90 LET X$ = STR$(B) + X$ - 110 LET A = (A - B) / 2 - 120 IF (A > 0) GOTO 70 - 125 PRINT - 130 PRINT "As binary: ";X$ - 135 PRINT - 140 END - diff --git a/guess.bas b/guess.bas deleted file mode 100644 index 763ad8f..0000000 --- a/guess.bas +++ /dev/null @@ -1,22 +0,0 @@ - 10 rem 12/13/2019 Ken guess a number game - 100 REM GUESSING GAME - 110 SHELL "cls" - 120 PRINT "GUESS THE NUMBER BETWEEN 1 AND 100." - 140 LET X = INT(100*RND(0)+1) - 150 LET N = 0 - 160 PRINT "YOUR GUESS"; - 170 INPUT G - 180 LET N = N+1 - 190 IF G = X THEN 300 - 200 IF G < X THEN 250 - 210 PRINT "TOO LARGE, GUESS AGAIN" - 220 GOTO 160 - 250 PRINT "TOO SMALL, GUESS AGAIN" - 260 GOTO 160 - 300 PRINT "YOU GUESSED IT, IN"; N; "TRIES" - 310 PRINT "ANOTHER GAME (YES = 1, NO = 0)"; - 320 INPUT A - 330 IF A = 1 THEN 140 - 340 PRINT "THANKS FOR PLAYING" - 350 END - diff --git a/ohmslaw.bas b/ohmslaw.bas deleted file mode 100644 index ac86ff7..0000000 --- a/ohmslaw.bas +++ /dev/null @@ -1,311 +0,0 @@ -5 REM - COMPACTED:6/08/84 -7 REM - Removed LPRINT references 4-13-2020 Ken -10 PRINT " -=*OHM'S LAW*=-" -40 PRINT " MENU" -50 PRINT:PRINT TAB(10);"(1) Find I, given VOLTAGE and RESISTANCE (E and R)" -70 PRINT TAB(10);"(2) Find R, given VOLTAGE and CURRENT (V and I)" -90 PRINT TAB(10);"(3) Find E, given CURRENT and RESISTANCE (I and R)" -110 PRINT TAB(10);"(4) Find P (POWER), given VOLTAGE and CURRENT (E and I)" -130 PRINT TAB(10);"(5) Find P (POWER), given CURRENT and RESISTANCE (I and R)" -150 PRINT TAB(10);"(6) Find P (POWER), given VOLTAGE and RESISTANCE (E and R)" -170 PRINT TAB(10);"(7) Find two resistances in parallel, given R1 and R2" -190 PRINT TAB(10);"(8) Find RT, given unequal R1, R2, R3, R4 in parallel" -270 PRINT TAB(10);"(9) Find RT, given R1,R2,R3,R4 in SERIES-PARALLEL" -290 PRINT TAB(10);"(10) Find TOTAL CAPACITANCE (CT), in series circuit" -310 PRINT TAB(10);"(11) Find TOTAL CAPACITANCE (CT), 2 caps, parallel circuit" -330 PRINT TAB(10);"(12) Find TOTAL CAPACITANCE (CT), 3 caps in parallel" -350 PRINT TAB(10);"(13) Find PEAK AC VOLTAGE, given RMS value" -370 PRINT TAB(10);"(14) Find RMS VOLTAGE, given PEAK value" -390 PRINT TAB(10);"(15) Find INDUCTIVE REACTANCE (XL)" -410 PRINT TAB(10);"(16) Find CAPACITIVE REACTANCE (XC)" -430 PRINT TAB(10);"(17) Find IMPEDANCE (Z) of a series circuit" -445 PRINT TAB(10);"(18) Find IMPEDANCE (Z) of a parallel circuit" -447 PRINT -450 PRINT " Select the number you require from the menu and press 'RETURN'" -485 PRINT -490 INPUT "Caps Lock ON. Enter choice from above or -1 to exit :",C -515 IF C = -1 THEN END -517 PRINT "Choice is:";C -520 IF C= 0 OR C> 18 THEN 10 -530 ON C GOTO 540,710,880,1050,1220,1380,1540,1700,1930,2190,2360,2560,2770,2930,3070,3260,3430,3680 -540 PRINT "Calculate CURRENT (I), given VOLTAGE and RESISTANCE (E and R)" -555 PRINT -560 INPUT "What is the value of E, in volts:",V -580 INPUT "Now enter the value of R, in ohms:",R -600 LET I= (V/R) -610 PRINT " I= ";(V/R);"amperes" -630 PRINT -640 PRINT " Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -660 IF ANS$="Y" THEN 540 -670 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -690 IF ANS$="Y" THEN 10 -700 GOTO 10020 -710 PRINT "Calculate RESISTANCE (R), given VOLTAGE and CURRENT (E and I)" -730 PRINT:PRINT -740 INPUT "Input the value of E, in volts:",V -760 INPUT "Now enter the value of I, in amperes:",I -780 LET R=(V/I):PRINT "R= ";(V/I);"ohms" -800 PRINT -810 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -830 IF ANS$="Y" THEN 710 -835 PRINT -840 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -860 IF ANS$="Y" THEN 10 -870 GOTO 10020 -875 PRINT -880 PRINT "Calculate VOLTAGE (E), given CURRENT and RESISTANCE (I and R)" -895 PRINT -900 INPUT "Enter the value for I, in amperes:",I -920 INPUT "Now enter the value for R, in ohms:",R -940 LET E=(I*R):PRINT "E= ";(I*R);"volts" -960 PRINT -970 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -990 IF ANS$="Y" THEN 880 -995 PRINT -1000 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1020 IF ANS$="Y" THEN 10 -1030 GOTO 10020 -1040 PRINT -1050 PRINT "Calculate POWER(P), given VOLTAGE(E) and CURRENT(I)" -1065 PRINT -1070 INPUT "Input the value for E, in volts:",V -1090 INPUT "Now enter the value for I, in amperes:",I -1110 LET P=V*I:PRINT "I= ";(V*I);"watts" -1130 PRINT -1140 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -1160 IF ANS$="Y" THEN 1050 -1175 PRINT -1180 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1200 IF ANS$="Y" THEN 10 -1210 GOTO 10020 -1220 PRINT "Calculate POWER(P), given CURRENT(I) and RESISTANCE(R)" -1235 PRINT -1240 INPUT "Enter the value for I, in amperes:",I -1260 INPUT "Now enter the value for R, in ohms:",R -1280 LET P=(I*I)*R:PRINT "P= ";(I*I)*R;"watts" -1300 PRINT -1310 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -1330 IF ANS$="Y" THEN 1220 -1335 PRINT -1340 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1360 IF ANS$="Y" THEN 10 -1370 GOTO 10020 -1380 PRINT "Calculate POWER(P), given VOLTAGE(E) and RESISTANCE(R)" -1385 PRINT -1400 INPUT "Enter the value for E, in volts:",V -1420 INPUT "Now enter the value for R, in ohms:",R -1440 LET P=(V*V)/(R):PRINT "P= ";(V*V)/(R);"watts" -1460 PRINT -1470 PRINT "Do you wish to do this calculation again ? (Y/N)":INPUT ANS$ -1490 IF ANS$="Y" THEN 1380 -1495 PRINT -1500 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1520 IF ANS$="Y" THEN 10 -1530 GOTO 10020 -1535 PRINT -1540 PRINT "Calculate TOTAL RESISTANCE(RT) in parallel, given R1,R2" -1555 PRINT -1560 INPUT "Input the value for R1:",R1 -1580 INPUT "Now input the value for R2:",R2 -1600 LET RT= (R1*R2)/(R1+R2):PRINT "RT= ";(R1*R2)/(R1+R2);"ohms" -1620 PRINT -1630 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -1650 IF ANS$="Y" THEN 1540 -1655 PRINT -1660 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1680 IF ANS$="Y" THEN 10 -1690 GOTO 10020 -1695 PRINT -1700 PRINT "Calculate TOTAL RESISTANCE(RT), given unequal R1,R2,R3,R4 values" -1715 PRINT -1720 PRINT "Enter the values for R1,R2,R3 and R4, in ohms" -1740 INPUT "R1=",R1 -1750 INPUT "R2=",R2 -1760 INPUT "R3=",R3 -1770 INPUT "R4=",R4 -1780 PRINT "R1=";R1;"ohms" -1790 PRINT "R2=";R2;"ohms" -1800 PRINT "R3=";R3;"ohms" -1810 PRINT "R4=";R4;"ohms" -1820 LET RT=(1)/(1/R1+1/R2+1/R3+1/R4) -1830 PRINT "RT= ";(1)/(1/R1+1/R2+1/R3+1/R4);"ohms" -1850 PRINT -1860 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -1880 IF ANS$="Y" THEN 1700 -1885 PRINT -1890 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -1910 IF ANS$="Y" THEN 10 -1920 GOTO 10020 -1925 PRINT -1930 PRINT "Calculate TOTAL RESISTANCE(RT), in series-parallel," -1940 PRINT "given R1, R2, R3 and R4" -1965 PRINT -1970 PRINT "Enter the values for R1, R2, R3 and R4" -1990 INPUT "R1=",R1 -2000 INPUT "R2=",R2 -2010 INPUT "R3=",R3 -2020 INPUT "R4=",R4 -2030 PRINT "R1=";R1;"ohms" -2040 PRINT "R2=";R2;"ohms" -2050 PRINT "R3=";R3;"ohms" -2060 PRINT "R4=";R4;"ohms" -2070 PRINT -2080 LET RT=(1)/(1/(R1+R2))+(1/(R3+R4)) -2090 PRINT "RT=";(1)/(1/(R1+R2))+(1/(R3+R4));"ohms" -2110 PRINT -2120 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -2140 IF ANS$="Y" THEN 1930 -2145 PRINT -2150 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -2170 IF ANS$="Y" THEN 10 -2180 GOTO 10020 -2185 PRINT -2190 PRINT "Calculate TOTAL CAPACITANCE(CT), in series circuit, given C1 and C2" -2205 PRINT -2210 INPUT "Enter value for C1, in MFD:",C1 -2220 INPUT "Now enter the value for C2, in MFD:",C2 -2240 PRINT "C1=";C1;"mfd" -2250 PRINT "C2=";C2;"mfd" -2260 LET CT=(C1*C2)/(C1+C2):PRINT "CT=";(C1*C2)/(C1+C2);"mfd" -2280 PRINT -2290 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -2310 IF ANS$="Y" THEN 2190 -2315 PRINT -2320 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -2340 IF ANS$="Y" THEN 10 -2350 GOTO 10020 -2355 PRINT -2360 PRINT "Calculate TOTAL CAPACITANCE(CT), parallel circuit, given C1 and C2" -2395 PRINT -2400 INPUT "Enter the value for C1, in mfd:",C1 -2420 INPUT "Now enter the value for C2, in mfd:",C2 -2440 PRINT "C1=";C1;"mfd" -2450 PRINT "C2=";C2;"mfd" -2460 LET CT=(C1*C2)/(C1+C2):PRINT "CT=";(C1*C2)/(C1+C2);"mfd" -2480 PRINT -2490 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -2510 IF ANS$="Y" THEN 2360 -2515 PRINT -2520 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -2540 IF ANS$="Y" THEN 10 -2550 GOTO 10020 -2555 PRINT -2560 PRINT "Calculate TOTAL CAPACITANCE(CT) for a parallel circuit," -2570 PRINT "given C1, C2 and C3, in mfd" -2595 PRINT -2600 INPUT "C1=",C1 -2610 INPUT "C2=",C2 -2620 INPUT "C3=",C3 -2630 PRINT "C1=";C1;"mfd" -2640 PRINT "C2=";C2;"mfd" -2650 PRINT "C3=";C3;"mfd" -2660 PRINT -2670 LET CT=(C1+C2+C3):PRINT "CT=";(C1+C2+C3);"mfd" -2690 PRINT -2700 PRINT "D0 you wish to do this calculation again? (Y/N)":INPUT ANS$ -2720 IF ANS$="Y" THEN 2560 -2725 PRINT -2730 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -2750 IF ANS$="Y" THEN 10 -2760 GOTO 10020 -2765 PRINT -2770 PRINT "Calculate PEAK AC VOLTAGE, given RMS value" -2785 PRINT -2790 INPUT "Enter the RMS value, in volts:",RMS -2810 PRINT "RMS=";RMS;"volts" -2820 LET PEAK=(RMS*1.414):PRINT "PEAK=";(RMS*1.414);"volts" -2840 PRINT -2850 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -2870 IF ANS$="Y" THEN 2770 -2875 PRINT -2880 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -2900 IF ANS$="Y" THEN 10 -2910 GOTO 10020 -2920 PRINT -2930 PRINT "Calculate RMS VOLTAGE, given a value in PEAK VOLTS" -2945 PRINT -2950 INPUT "Enter the PEAK value, in volts AC:",PEAK -2960 PRINT "PEAK VOLTS=";PEAK -2970 LET RMS=(.707*PEAK):PRINT "RMS=";(.707*PEAK);"volts AC" -3000 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -3020 IF ANS$="Y" THEN 2930 -3025 PRINT -3030 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -3050 IF ANS$="Y" THEN 10 -3060 GOTO 10020 -3065 PRINT -3070 PRINT "Calculate INDUCTIVE REACTANCE (XL), given FREQUENCY and INDUCTANCE" -3090 PRINT -3100 INPUT "Enter FREQUENCY (F), in Hertz:",FREQ -3120 PRINT "FREQUENCY=";FREQ;"Hertz -3130 INPUT "Now enter the value for INDUCTANCE (L), in henrys:",L -3150 PRINT "INDUCTANCE=";L;"henrys" -3160 LET XL=(2*3.1416)*FREQ*L:PRINT "XL=";(2*3.1416)*FREQ*L;"ohms" -3180 PRINT -3190 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -3210 IF ANS$="Y" THEN 3070 -3215 PRINT -3220 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -3240 IF ANS$="Y" THEN 10 -3245 GOTO 10020 -3250 PRINT -3260 PRINT "Calculate CAPACITIVE REACTANCE (XC), given FREQ(F) and CAP(C)" -3275 PRINT -3280 INPUT "Enter the value for FREQ(F), in Hertz:",F -3290 PRINT "FREQ(F)=";F;"Hertz" -3300 INPUT "Now enter the value for CAP(C), in mfd:",C -3310 PRINT "CAP(C)=";C;"mfd" -3320 PRINT -3330 LET XC=(1)/((2*3.1416)*F*C):PRINT "XC=";(1)/((2*3.1416)*F*C);"ohms" -3350 PRINT -3360 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -3380 IF ANS$="Y" THEN 3260 -3385 PRINT -3390 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -3410 IF ANS$="Y" THEN 10 -3415 GOTO 10020 -3420 PRINT -3430 PRINT "Calculate IMPEDANCE(Z) of a series circuit, given values of" -3435 PRINT "RES(R), CAPACITIVE REACTANCE(XC) and INDUCTIVE REACTANCE(XL)" -3446 PRINT -3450 INPUT "Enter the value for RESISTANCE(R), in ohms:",R -3470 INPUT "Enter the value for CAPACITIVE REACTANCE(XC), in ohms:",XC -3490 INPUT "Enter the value for INDUCTIVE REACTANCE(XL), in ohms:",XL -3510 PRINT -3520 PRINT "RESISTANCE(R)=";R;"ohms" -3530 PRINT "CAPACITIVE REACTANCE(XC)=";XC;"ohms" -3540 PRINT "INDUCTIVE REACTANCE(XL)=";XL;"ohms" -3550 PRINT -3560 LET Z=SQR(R^2+((XL-XC)^2)) -3570 PRINT "IMPEDANCE(Z)=";SQR(R^2+((XL-XC)^2));"ohms" -3590 PRINT -3600 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -3620 IF ANS$="Y" THEN 3430 -3625 PRINT -3630 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -3650 IF ANS$="Y" THEN 10 -3660 GOTO 10020 -3670 PRINT -3680 PRINT "Calculate IMPEDANCE (Z) of a parallel circuit" -3700 PRINT -3710 INPUT "Enter the value of L, in henrys:",L -3730 INPUT "Enter the value for FREQ (F), in Hertz:",F -3750 INPUT "Now enter the value for RESISTANCE (R) in ohms:",R -3765 PRINT "INDUCTANCE (L)=";L;"henrys" -3770 PRINT "FREQ (F)=";F;" Hertz" -3775 PRINT "RESISTANCE (R)=";R;"ohms" -3776 PRINT -3780 LET Z=((2*3.1416*F*L)^2)/(R) -3790 PRINT "IMPEDANCE (Z)=";((2*3.1416*F*L)^2)/(R);"ohms" -3810 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$ -3830 IF ANS$="Y" THEN 3680 -3840 PRINT -3850 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$ -3870 IF ANS$="Y" THEN 10 -3880 GOTO 10020 -3890 PRINT -10020 PRINT "Glad to have been of service! BYE!! -12000 REM -------------------------------------------------------------------------- -12010 REM Change line number 0 to line number 5 -12020 REM For automated testing, added 515 IF C = -1 THEN END -12999 END diff --git a/profile.bas b/profile.bas deleted file mode 100644 index d5d2df0..0000000 --- a/profile.bas +++ /dev/null @@ -1,5 +0,0 @@ -OPTION TERMINAL ANSI -OPTION EDIT "nano" -OPTION DISABLE COMMAND "renum" -OPTION RENUM "" - diff --git a/tictac.bas b/tictac.bas deleted file mode 100644 index 6705963..0000000 --- a/tictac.bas +++ /dev/null @@ -1,174 +0,0 @@ - 2 PRINT TAB(30);"TIC-TAC-TOE" - 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" - 6 PRINT - : PRINT - : PRINT - 8 PRINT "THE BOARD IS NUMBERED:" - 10 PRINT " 1 2 3" - 12 PRINT " 4 5 6" - 14 PRINT " 7 8 9" - 16 PRINT - : PRINT - : PRINT - 20 DIM SS(9) - 50 INPUT"DO YOU WANT 'X' OR 'O'";C$ - 55 IF C$="X"THEN 475 - 57 IF C$="x" THEN 475 - 60 P$="O" - : Q$="X" - 100 G=-1 - : H=1 - : IF SS(5)<>0 THEN 103 - 102 SS(5)=-1 - : GOTO 195 - 103 IF SS(5)<>1 THEN 106 - 104 IF SS(1)<>0 THEN 110 - 105 SS(1)=-1 - : GOTO 195 - 106 IF SS(2)=1 AND SS(1)=0 THEN 181 - 107 IF SS(4)=1 AND SS(1)=0 THEN 181 - 108 IF SS(6)=1 AND SS(9)=0 THEN 189 - 109 IF SS(8)=1 AND SS(9)=0 THEN 189 - 110 IF G=1 THEN 112 - 111 GOTO 118 - 112 J=3*INT((M-1)/3)+1 - 113 IF 3*INT((M-1)/3)+1=M THEN - : K=1 - : END IF - 114 IF 3*INT((M-1)/3)+2=M THEN - : K=2 - : END IF - 115 IF 3*INT((M-1)/3)+3=M THEN - : K=3 - : END IF - 116 GOTO 120 - 118 FOR J=1 TO 7 STEP 3 - : FOR K=1 TO 3 - 120 IF SS(J)<>G THEN 130 - 122 IF SS(J+2)<>G THEN 135 - 126 IF SS(J+1)<>0 THEN 150 - 128 SS(J+1)=-1 - : GOTO 195 - 130 IF SS(J)=H THEN 150 - 131 IF SS(J+2)<>G THEN 150 - 132 IF SS(J+1)<>G THEN 150 - 133 SS(J)=-1 - : GOTO 195 - 135 IF SS(J+2)<>0 THEN 150 - 136 IF SS(J+1)<>G THEN 150 - 138 SS(J+2)=-1 - : GOTO 195 - 150 IF SS(K)<>G THEN 160 - 152 IF SS(K+6)<>G THEN 165 - 156 IF SS(K+3)<>0 THEN 170 - 158 SS(K+3)=-1 - : GOTO 195 - 160 IF SS(K)=H THEN 170 - 161 IF SS(K+6)<>G THEN 170 - 162 IF SS(K+3)<>G THEN 170 - 163 SS(K)=-1 - : GOTO 195 - 165 IF SS(K+6)<>0 THEN 170 - 166 IF SS(K+3)<>G THEN 170 - 168 SS(K+6)=-1 - : GOTO 195 - 170 GOTO 450 - 171 IF SS(3)=G AND SS(7)=0 THEN 187 - 172 IF SS(9)=G AND SS(1)=0 THEN 181 - 173 IF SS(7)=G AND SS(3)=0 THEN 183 - 174 IF SS(9)=0 AND SS(1)=G THEN 189 - 175 IF G=-1 THEN - : G=1 - : H=-1 - : GOTO 110 - : END IF - 176 IF SS(9)=1 AND SS(3)=0 THEN 182 - 177 FOR I=2 TO 9 - : IF SS(I)<>0 THEN 179 - 178 SS(I)=-1 - : GOTO 195 - 179 NEXT I - 181 SS(1)=-1 - : GOTO 195 - 182 IF SS(1)=1 THEN 177 - 183 SS(3)=-1 - : GOTO 195 - 187 SS(7)=-1 - : GOTO 195 - 189 SS(9)=-1 - 195 PRINT - : PRINT"THE COMPUTER MOVES TO..." - 202 GOSUB 1000 - 205 GOTO 500 - 450 IF G=1 THEN 465 - 455 IF J=7 AND K=3 THEN 465 - 460 NEXT K - : NEXT J - 465 IF SS(5)=G THEN 171 - 467 GOTO 175 - 475 P$="X" - : Q$="O" - 500 PRINT - : INPUT"WHERE DO YOU MOVE";M - 502 IF M=0 THEN - : PRINT"THANKS FOR THE GAME." - : GOTO 2000 - : END IF - 503 IF M>9 THEN 506 - 505 IF SS(M)=0 THEN 510 - 506 PRINT"THAT SQUARE IS OCCUPIED." - : PRINT - : PRINT - : GOTO 500 - 510 G=1 - : SS(M)=1 - 520 GOSUB 1000 - 530 GOTO 100 - 1000 PRINT - : FOR I=1 TO 9 - : PRINT" "; - : IF SS(I)<>-1 THEN 1014 - 1012 PRINT Q$;" "; - : GOTO 1020 - 1014 IF SS(I)<>0 THEN 1018 - 1016 PRINT" "; - : GOTO 1020 - 1018 PRINT P$;" "; - 1020 IF I<>3 AND I<>6 THEN 1050 - 1030 PRINT - : PRINT"---+---+---" - 1040 GOTO 1080 - 1050 IF I=9 THEN 1080 - 1060 PRINT"!"; - 1080 NEXT I - : PRINT - : PRINT - : PRINT - 1095 FOR I=1 TO 7 STEP 3 - 1100 IF SS(I)<>SS(I+1)THEN 1115 - 1105 IF SS(I)<>SS(I+2)THEN 1115 - 1110 IF SS(I)=-1 THEN 1350 - 1112 IF SS(I)=1 THEN 1200 - 1115 NEXT I - : FOR I=1 TO 3 - : IF SS(I)<>SS(I+3)THEN 1150 - 1130 IF SS(I)<>SS(I+6)THEN 1150 - 1135 IF SS(I)=-1 THEN 1350 - 1137 IF SS(I)=1 THEN 1200 - 1150 NEXT I - : FOR I=1 TO 9 - : IF SS(I)=0 THEN 1155 - 1152 NEXT I - : GOTO 1400 - 1155 IF SS(5)<>G THEN 1170 - 1160 IF SS(1)=G AND SS(9)=G THEN 1180 - 1165 IF SS(3)=G AND SS(7)=G THEN 1180 - 1170 RETURN - 1180 IF G=-1 THEN 1350 - 1200 PRINT"YOU BEAT ME!! GOOD GAME." - : GOTO 2000 - 1350 PRINT"I WIN, TURKEY!!!" - : GOTO 2000 - 1400 PRINT"IT'S A DRAW. THANK YOU." - 2000 END -