Category : BASIC Source Code
Archive   : ALGEBRA1.ZIP
Filename : CBS.BAS
2 DEF SEG=64:POKE 23,&H40 OR PEEK(23)
3 KEY OFF:CLS:N$=CHR$(0):KEY 2,N$:KEY 6,N$:KEY 7,N$:KEY 5,N$:KEY 8,N$
4 KEY (9) ON:KEY(10) ON
5 ON KEY(9) GOSUB 56000:ON KEY(10) GOSUB 56020:FOR X=1 TO 10:KEY X,"":NEXT
6 GOSUB 56240
8 GOSUB 56040
9 CLS
100 DEF FN R(X)=INT(X*RND(1)+1)
110 DEF FN SIGN(X)=-3+2*FN R(2)
120 DEF FN VAR(X)=119+FN R(3)
125 DEF FN TIM(X)=VAL(RIGHT$(TIME$,2))*X
130 GOSUB 50000
140 GOSUB 52000
150 GOSUB 53000
200 CLS:LOCATE 3,15:PRINT CHR$(201)STRING$(8,205)CHR$(187):PRINT TAB(15)CHR$(186)" Menu "CHR$(186)
205 PRINT TAB(15)CHR$(200)STRING$(8,205)CHR$(188):PRINT:PRINT
210 PRINT TAB(6)"1) Instructions":PRINT
220 PRINT TAB(6)"2) Learn about the FOIL method":PRINT
230 PRINT TAB(6)"3) Work on problems":PRINT
240 PRINT TAB(6)"4) Exit the program"
250 PRINT:PRINT:PRINT TAB(8)"Your selection: ";:LOCATE ,,1
255 ZZ$=INKEY$:IF ZZ$="" THEN 255
260 ZZ=ASC(ZZ$):IF ZZ<49 OR ZZ>52 THEN 255
270 IF ZZ=50 OR ZZ=51 THEN MQ%=1
280 PRINT ZZ$;:LOCATE ,,0:ON ZZ-48 GOSUB 55500,40000,1000,300
290 GOTO 200
300 RETURN 310
310 CLS
320 I$="Thank you, "+N$+"!":LOCATE 8,(40-LEN(I$))/2:PRINT I$:PRINT:PRINT TAB(4)"I hope you enjoyed this program."
340 FOR X=1 TO 5000:NEXT
350 SYSTEM:END
1000 '
1010 CLS:LOCATE 5,1:PRINT N$",":PRINT:PRINT"you may try up to 9 problems.":PRINT:PRINT"How many would you like? ";:LOCATE ,,1
1012 NU$=INKEY$
1015 NU$=INKEY$:IF NU$="" THEN 1015
1020 IF NU$<"1" OR NU$>"9" THEN 1015
1040 LOCATE ,,0:PRINT NU$:N%=VAL(NU$)
1050 E3=0:E4=0
1100 FOR P=1 TO N%
1110 GOSUB 2000
1210 CLS:LOCATE 1,6:PRINT "Error Summary for Problem #";RIGHT$(STR$(P),1):PRINT TAB(6)STRING$(28,"-")
1220 LOCATE 5,1,0:PRINT "Error";:LOCATE ,33,0:PRINT "Number":PRINT STRING$(5,"-");TAB(33)STRING$(6,"-")
1230 LOCATE 8,1,0:PRINT "Multiplying Terms ...............";USING"###";E1
1240 LOCATE 10,1,0:PRINT "Combining Like Terms ............";USING"###";E2
1250 LOCATE 13,1,0:PRINT "Total ...........................";USING"###";E1+E2
1260 ZZ=E1+E2:IF ZZ>2 THEN ZZ=2
1270 LOCATE 18,1,0:XX=3*ZZ+FN R(3)-1:PRINT TAB(INT((40-LEN(ME$(XX)))/2)) ME$(XX)
1280 E3=E3+E1:E4=E4+E2
1290 IF P=N% THEN GOSUB 12000:GOTO 1500
1300 LOCATE 23,6,0:PRINT "Press ";:COLOR O,7:PRINT"ENTER";:COLOR 7,0:PRINT" for next problem.";
1305 LOCATE 25,13,0:PRINT"Press ";:COLOR 0,7:PRINT"Q";:COLOR 7,0:PRINT" to quit.";
1310 ZZ$=INKEY$:IF ZZ$="" THEN 1310
1320 IF ZZ$<> CHR$(13) AND ZZ$<>"Q" AND ZZ$<>"q" THEN 1310
1325 IF ZZ$>< CHR$(13) THEN 1500
1400 NEXT P
1500 '
1510 CLS:LOCATE 1,10:PRINT "Total Error Analysis":PRINT TAB(10)STRING$(20,"-")
1520 LOCATE 4,34,0:PRINT "Average":LOCATE 5,36,0:PRINT "per":LOCATE 6,1,0:PRINT "Error";:LOCATE ,34,0:PRINT "Problem";:LOCATE 6,25,0:PRINT "Total":PRINT STRING$(5,"-");TAB(25)STRING$(5,"-");TAB(34)STRING$(7,"-")
1530 LOCATE 9,1,0:PRINT "Multiplying Terms .......";USING"###";E3;:LOCATE ,35,0:PRINT USING"##.##";E3/P
1540 LOCATE 11,1,0:PRINT "Combining Like Terms ....";USING"###";E4;:LOCATE ,35,0:PRINT USING"##.##";E4/P
1560 LOCATE 14,1,0:PRINT "Total ...................";USING"###";E3+E4;:LOCATE ,35,0:PRINT USING"##.##";(E3+E4)/P
1570 PRINT:PRINT:PRINT:PRINT TAB(8)"You completed"P"problem";:IF P>1 THEN PRINT"s." ELSE PRINT"."
1575 LOCATE 25,10,0:PRINT"Press ";:COLOR 0,7:PRINT"ENTER";:COLOR 7,0:PRINT" for Menu.";:GOSUB 12020
1600 RETURN
2000 '
2010 E1=0:E2=0
2020 GOSUB 25000
2022 L1$="":L2$="":IF VA$(1,1)<>"" THEN L1$=VA$(1,1)
2023 IF VA$(2,1)<>"" THEN IF L1$<>VA$(2,1) THEN L2$=VA$(2,1):GOTO 2030
2024 IF VA$(1,2)<>"" THEN L2$=VA$(1,2)
2025 IF VA$(2,2)<>"" THEN L2$=VA$(2,2)
2030 CLS:LOCATE 1,15:PRINT "Problem #";USING"#";P:PRINT TAB(15)STRING$(10,"-")
2040 VP%=5:HP%=37:FOR I=1 TO 2:FOR J=1 TO 2:CO%=CO%(I,J):VA$=VA$(I,J):GOSUB 10500:HP%=HP%-LEN(RE$)-ABS(J=2 AND CO%>=0):NEXT J,I:HP%=HP% / 2 : GOSUB 10000
2050 LOCATE 12,1,0:PRINT "________________________________________";
2060 V2%=8:H2%=41:FOR I = 1 TO 4:PA%=I:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:H2%=(H2%-LEN(RE$))-ABS(I<>1 AND CO%>0):NEXT I:H2%=H2% \ 2:FOR I=1 TO 4:PA%=I:GOSUB 15000:NEXT I
2070 V3%=11:IF VA$(1,1)=VA$(2,1) AND VA$(1,2)=VA$(2,2) THEN 2100
2080 IF VA$(1,2)=VA$(2,1) AND VA$(1,1)=VA$(2,2) THEN 2120
2090 H3%=H2%:GOTO 2140
2100 H3%=41:PA%=2:GOSUB 14000:VA$=PR$:CO%=CO%(1,2)*CO%(2,1)+CO%(1,1)*CO%(2,2):GOSUB 10500:H3%=H3%-LEN(RE$)-ABS(CO%>0)+ABS(LEN(RE$)*CO%=0):PA%=1:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:H3%=H3%-LEN(RE$)
2110 PA%=4:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:H3%=H3%-LEN(RE$)-ABS(CO%>0):H3%=H3%/2:GOTO 2140
2120 H3%=41:PA%=1:GOSUB 14000:VA$=PR$:CO%=CO%(1,1)*CO%(2,1)+CO%(1,2)*CO%(2,2):GOSUB 10500:H3%=H3%-LEN(RE$)-ABS(CO%>0)+ABS(LEN(RE$)*CO%=0):PA%=2:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:H3%=H3%-LEN(RE$)
2130 PA%=3:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:H3%=H3%-LEN(RE$)-ABS(CO%>0):H3%=H3%/2
2140 GOSUB 20000
2150 GOSUB 16000:PRINT "Nice job, ";N$;".":PRINT :PRINT "You're done with this problem."
2160 GOSUB 12000:RETURN
10000 '
10010 CO%=CO%(1,1):VA$=VA$(1,1):GOSUB 10500:PR$(1)=RE$
10020 CO%=ABS(CO%(1,2)):VA$=VA$(1,2):GOSUB 10500:PR$(2)=RE$
10030 CO%=CO%(2,1):VA$=VA$(2,1):GOSUB 10500:PR$(3)=RE$
10040 CO%=ABS(CO%(2,2)):VA$=VA$(2,2):GOSUB 10500:PR$(4)=RE$
10045 FOR ZZZ=1 TO 4:PR$(ZZZ)=MID$(PR$(ZZZ),INSTR(PR$(ZZZ)," ")+1,LEN(PR$(ZZZ))):NEXT ZZZ
10050 LOCATE VP%,HP%,0:PRINT "(";PR$(1);:IF CO%(1,2)<0 THEN PRINT "-";:GOTO 10070
10060 PRINT "+";
10070 PRINT PR$(2);")(";PR$(3);:IF CO%(2,2)<0 THEN PRINT "-";:GOTO 10090
10080 PRINT "+";
10090 PRINT PR$(4);")"
10100 RETURN
10500 IF VA$="" THEN RE$=STR$(CO%):GOTO 10540
10505 IF CO%=0 THEN RE$="0":RETURN
10510 IF CO%=1 THEN RE$=VA$:GOTO 10540
10520 IF CO%=-1 THEN RE$="-"+VA$:GOTO 10540
10530 RE$=STR$(CO%)+VA$
10540 RE$=MID$(RE$,INSTR(RE$," ")+1,LEN(RE$)):RETURN
11000 '
11010 VB%=VP%-1:VT%=VB%-1
11020 IF PA%<3 THEN HF%=HP%+LEN(PR$(1))-(LEN(VA$(1,1)))-(CO%(1,1)=1)-(CO%(1,1)=-1):GOTO 11040
11030 HF%=HP%+LEN(PR$(1))+LEN(PR$(2))+1+(CO%(1,2)<>1 AND CO%(1,2)<>-1)-(LEN(VA$(1,2))=0)
11040 IF PA%=1 OR PA%=3 THEN HS%=HP%+3+LEN(PR$(1)+PR$(2)+PR$(3))-LEN(VA$(2,1))-(CO%(2,1)=1)-(CO%(2,1)=-1):GOTO 11090
11050 HS%=HP%+5+LEN(PR$(1)+PR$(2)+PR$(3))
11090 IF ER%=0 THEN COLOR 7,0 ELSE COLOR 0,0
11100 LOCATE VB%,HF%,0:PRINT CHR$(25);:LOCATE ,HS%,0:PRINT CHR$(25)
11120 LOCATE VT%,HF%,0:PRINT "Ú";STRING$(HS%-HF%-1,"Ä");"¿"
11130 COLOR 7,0:RETURN
12000 '
12010 LOCATE 25,9,0:PRINT "Press ";:COLOR 0,7:PRINT"ENTER";:COLOR 7,0:PRINT" to continue.";
12015 ZZ$=INKEY$
12020 ZZ$=INKEY$:IF ZZ$="" THEN 12020
12030 IF ASC(ZZ$)<>13 THEN 12020
12040 LOCATE 25,7,0:PRINT STRING$(30,32);:RETURN
13000 '
13010 G$="":G1$="":CT=0
13020 LOCATE V,H,1
13025 G1$=INKEY$
13030 G1$=INKEY$:IF G1$="" THEN 13030 ELSE IF G1$=CHR$(13) AND G$<>"-" THEN RETURN
13031 IF G1$=CHR$(8) THEN 13060 ELSE IF (CT>=6 AND G1$<>CHR$(8)) OR G$="0" THEN 13030
13032 IF ASC(G1$) > 87 AND ASC(G1$)< 91 THEN G1$=CHR$(ASC(G1$)+32)
13033 IF G1$="-" OR (G1$>="0" AND G1$<="9") OR (G1$>="x" AND G1$<="z") THEN 13034 ELSE 13030
13034 IF G1$="0" AND G$="-" THEN 13030 ELSE IF G1$="-" AND CT<>0 THEN 13030
13035 IF G1$>="0" AND G1$<="9" AND CT>0 THEN IF RIGHT$(G$,1)>"9" AND G1$<>"2" THEN 13030
13038 IF G1$="2" THEN 13095 ELSE ZZ=ASC(G1$):IF G1$>="x" AND G1$<="z" THEN IF LEN(G$)>0 THEN FOR XX=1 TO LEN(G$):IF ASC(MID$(G$,XX,1))=ZZ THEN 13030 ELSE NEXT
13039 IF G1$>="x" AND G1$<="z" THEN IF G1$<>L1$ AND G1$<>L2$ THEN 13030
13040 G$=G$+G1$:LOCATE V,H,1:PRINT G$;:CT=CT+1:GOTO 13030
13055 IF G1$<>CHR$(8) THEN 13090
13060 IF G$<>"" THEN PRINT CHR$(29);" ";CHR$(29);
13070 IF LEN(G$)>1 THEN G$=LEFT$(G$,LEN(G$)-1):CT=CT-1:GOTO 13030
13080 G$="":CT=0:GOTO 13030
13090 IF G1$<>"2" THEN 13030
13095 IF CT>0 THEN IF RIGHT$(G$,1)=CHR$(253) THEN 13030 ELSE IF RIGHT$(G$,1)>="x" AND RIGHT$(G$,1)<="z" THEN G1$="ý"
13100 G$=G$+G1$:CT=CT+1:LOCATE V,H,1:PRINT G$;:GOTO 13030
14000 '
14010 ON PA% GOSUB 14100,14200,14300,14400:IF RIGHT$(PR$,1)>="a" AND RIGHT$(PR$,1) <="z" AND RIGHT$(PR$,2)=RIGHT$(PR$,1)+RIGHT$(PR$,1) THEN PR$=LEFT$(PR$,LEN(PR$)-1)+"ý"
14020 RETURN
14100 PR%=CO%(1,1)*CO%(2,1):IF VA$(1,1)
14200 PR%=CO%(1,1)*CO%(2,2):IF VA$(1,1)
14300 PR%=CO%(1,2)*CO%(2,1):IF VA$(1,2)
14400 PR%=CO%(1,2)*CO%(2,2):IF VA$(1,2)
15000 '
15010 GOSUB 16000
15020 ON PA% GOTO 15030,15040,15050,15060
15030 PN$="First":GOTO 15100
15040 PN$="Outside":GOTO 15100
15050 PN$="Inside":GOTO 15100
15060 PN$="Last"
15100 GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:C2$=RE$
15110 LOCATE 14,1:PRINT "Product of ";PN$;" terms: ";:V=14:H=21+LEN(PN$):GOSUB 13000:IF G$="" THEN GOSUB 16000:GOTO 15110
15115 C1$=G$:GOSUB 30000:IF C THEN 15500
15120 E1=E1+1
15150 LOCATE 16,1,0:PRINT "That's not right, ";N$;".":PRINT :PRINT "Try again."
15160 GOSUB 12000:GOSUB 16000:GOSUB 11000
15200 LOCATE 14,1,0:PRINT "Product of ";PN$;" terms: ";:V=14:H=21+LEN(PN$):GOSUB 13000:IF G$="" THEN GOSUB 16000:GOTO 15200
15210 C1$=G$:GOSUB 30000:IF C THEN 15500
15220 E1=E1+1
15250 LOCATE 16,1,0:PRINT "Sorry, "N$;".":PRINT
15255 IF PA%>2 AND CO%(1,2)<0 THEN PRINT "-";
15260 PRINT PR$(1+ABS(PA%>2));" * ";:IF (PA%=2 OR PA%=4) AND CO%(2,2)<0 THEN PRINT"(-"PR$(3+ABS(PA%/2=PA%\2));") = ";C2$;".":GOTO 15270
15263 IF LEFT$(PR$(3+ABS(PA%/2=PA%\2)),1)="-" THEN PRINT"("PR$(3+ABS(PA%/2=PA%\2))") = ";C2$".":GOTO 15270
15265 PRINT PR$(3+ABS(PA%/2=PA%\2));" = ";C2$"."
15270 GOSUB 12000:GOSUB 16000:GOTO 15200
15500 ER%=1:GOSUB 11000:ER%=0:GOSUB 16000
15510 IF PA%<>1 AND LEFT$(C2$,1)<>"-" THEN C2$="+"+C2$
15520 LOCATE V2%:T1%=H2%-1:IF PA%=1 THEN T1%=H2%:GOTO 15540
15530 T2%=PA%:FOR ZZ=1 TO T2%-1:PA%=ZZ:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:T1%=T1%+ABS(ZZ=1 OR PR%>0)+LEN(RE$):NEXT ZZ:PA%=T2%
15540 LOCATE ,T1%,0:PRINT C2$;:RETURN
16000 '
16010 T%=12:B%=24:CALL CLR(T%,B%):LOCATE 14,1,0
16020 RETURN
17000 '
17005 Z=INT(Z*100+5.000000E-01)/100:ZX$=""
17010 ZZ=INT(Z):ZX$=ZX$+MID$(STR$(ZZ),2,1)+"."
17020 ZZ=Z-ZZ:ZX$=ZX$+MID$(STR$(INT(ZZ*10+9.999999E-05)),2,1)
17030 ZZ=ZZ-(INT(ZZ*10+9.999999E-05)/10):ZX$=ZX$+MID$(STR$(INT(ZZ*100+1.000000E-01)),2,1):PRINT ZX$;
17040 RETURN
20000 GOTO 20010
20005 IF LEFT$(RE$,1)="-" THEN PRINT"- "RIGHT$(RE$,LEN(RE$)-1);::ELSE PRINT"+ "RE$;
20006 PRINT" = ";:RETURN
20010 GOSUB 16000:PRINT "Good work, "N$". You have":PRINT :PRINT "finished the multiplication. Now you":PRINT
20020 PRINT "must simplify the product by combining":PRINT :PRINT "any like terms."
20050 LT%=0:IF VA$(1,1)=VA$(2,1) AND VA$(1,2)=VA$(2,2) THEN LT%=1:PA%=2:GOSUB 14000:VA$=PR$:CO%=CO%(1,1)*CO%(2,2)+CO%(1,2)*CO%(2,1):GOSUB 10500:C1$=RE$:GOTO 20090
20060 IF VA$(1,2)=VA$(2,1) AND VA$(1,1)=VA$(2,2) THEN LT%=-1:PA%=1:GOSUB 14000:VA$=PR$:CO%=CO%(1,1)*CO%(2,1)+CO%(1,2)*CO%(2,2):GOSUB 10500:C1$=RE$
20090 GOSUB 12000
20100 GOSUB 16000:LOCATE 16,1,0:PRINT "Press ";:COLOR 0,7:PRINT"ENTER";:COLOR 7,0:PRINT" if there are no like terms.":LOCATE 14,1,0:PRINT "Enter sum of like terms: ";:V=14:H=27:GOSUB 13000:GOSUB 20500:IF C=1 THEN 20300
20110 E2=E2+1
20120 IF LT%=1 AND G$="" THEN LOCATE 19,1,0:PRINT "Sorry, ";N$;", there is a pair":PRINT :PRINT "of like terms.":GOTO 20150
20130 IF LT%=0 THEN LOCATE 20,1,0:PRINT "That is incorrect, ";N$;". There":PRINT :PRINT "are no like terms in the product.":GOSUB 12000:GOTO 20200
20140 LOCATE 19,1,0:PRINT "Not quite, ";N$;". You have made":PRINT :PRINT "an error in addition."
20150 VT%=V2%+1:VB%=VT%+1
20160 PA%=1:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:T1%=LEN(RE$):PA%=2:GOSUB 14000:VA$=PR$:CO%=ABS(PR%):GOSUB 10500:HF%=T1%+LEN(RE$):T1%=T1%+LEN(RE$):PA%=3:GOSUB 14000:VA$=PR$:CO%=ABS(PR%):GOSUB 10500:HS%=T1%+LEN(RE$)
20170 IF LT%=-1 THEN T1%=T1%+LEN(RE$):PA%=4:GOSUB 14000:VA$=PR$:CO%=ABS(PR%):GOSUB 10500:HS%=T1%+LEN(RE$):PA%=1:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:HF%=LEN(RE$)
20175 HF%=HF%+H2%:HS%=HS%+H2%
20178 PA%=2:GOSUB 14000:VA$=PR$:CO%=ABS(PR%):GOSUB 10500:HF%=HF%-CINT(LEN(RE$)/2)+1
20180 LOCATE VT%,HF%,0:PRINT CHR$(24);:LOCATE VT%,HS%,0:PRINT CHR$(24);
20185 LOCATE VB%,HF%,0:PRINT "À";STRING$(HS%-HF%-1,"Ä");"Ù"
20190 GOSUB 12000
20200 GOSUB 16000:LOCATE 16,1,0:PRINT "Press ";:COLOR 0,7:PRINT"ENTER";:COLOR 7,0:PRINT" if there are no like terms.":LOCATE 14,1,0:PRINT "Enter sum of like terms: ";:V=14:H=27:GOSUB 13000:GOSUB 20500:IF C THEN 20300
20210 E2=E2+1
20220 IF LT%=0 THEN LOCATE 18,1,0:PRINT "You can't combine any terms, ";N$;".":LOCATE 20,1,0:PRINT "None of the terms in the product are":PRINT :PRINT "like terms.":GOSUB 12000:GOTO 20200
20230 IF LT%=1 THEN LOCATE 19,1,0:PRINT "Sorry, ";N$;".":PRINT :PA%=2:GOSUB 14000:T1%=PR%:CO%=PR%:VA$=PR$:GOSUB 10500:PRINT RE$;" ";:PA%=3:GOSUB 14000:T1%=T1%+PR%:CO%=PR%:GOSUB 10500:GOSUB 20005:CO%=T1%:GOSUB 10500:PRINT RE$".":GOSUB 12000
20235 IF LT% THEN 20200
20240 LOCATE 19,1,0:PRINT "Sorry, ";N$;".":PRINT :PA%=1:GOSUB 14000:T1%=PR%:CO%=PR%:VA$=PR$:GOSUB 10500:PRINT RE$;" ";:PA%=4:GOSUB 14000:T1%=T1%+PR%:CO%=PR%:GOSUB 10500:GOSUB 20005:CO%=T1%:GOSUB 10500:PRINT RE$".":GOSUB 12000:GOTO 20200
20300 IF LT%=0 THEN 20400
20310 LOCATE V3%,H3%,0:IF LT%=-1 THEN 20350
20320 PA%=1:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:PRINT RE$;:IF LEFT$(C1$,1)="0" THEN 20335
20325 IF LEFT$(C1$,1)<>"-" THEN PRINT "+";
20330 PRINT C1$;
20335 PA%=4:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:IF LEFT$(RE$,1)<>"-" THEN PRINT "+";
20340 PRINT RE$:GOTO 20400
20350 PA%=2:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:PRINT RE$;:IF LEFT$(C1$,1)="0" THEN 20380
20360 IF LEFT$(C1$,1)<>"-" THEN PRINT "+";
20370 PRINT C1$;
20380 PA%=3:GOSUB 14000:CO%=PR%:VA$=PR$:GOSUB 10500:IF LEFT$(RE$,1)<>"-" THEN PRINT "+";
20390 PRINT RE$
20400 LOCATE V2%+1,1,0:PRINT STRING$(80,32);:RETURN
20500 IF G$="" AND LT%=0 THEN C=1:RETURN
20510 IF (G$="" AND LT%=1) OR (G$<>"" AND LT%=0) THEN C=0:RETURN
20520 C2$=G$:GOSUB 30000:RETURN
25000 '
25005 RANDOMIZE FN TIM(2)
25010 ON FN R(10) GOTO 25300,25500
25050 RANDOMIZE FN TIM(3)
25100 IF FN R(8)>5 THEN 25200
25105 RANDOMIZE FN TIM(4)
25110 CO%(1,1)=FN SIGN(0)*FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)="":CO%(2,1)=FN SIGN(0)*FN R(7):VA$(2,1)=VA$(1,1):CO%(2,2)=FN SIGN(0)*FN R(7):VA$(2,2)=VA$(1,2)
25120 IF CO%(1,1)*CO%(2,2)-CO%(1,2)*CO%(2,1)=0 THEN 25110
25130 RETURN
25200 RANDOMIZE FN TIM(1)
25205 CO%(1,1)=FN SIGN(0)*FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)=CHR$(FN VAR(0)):CO%(2,1)=FN SIGN(0)*FN R(7):VA$(2,1)=VA$(1,1):CO%(2,2)=FN SIGN(0)*FN R(7):VA$(2,2)=VA$(1,2)
25210 IF CO%(1,1)*CO%(2,2)-CO%(1,2)*CO%(2,1)=0 OR VA$(1,1)=VA$(1,2) THEN 25200
25220 RETURN
25300 RANDOMIZE FN TIM(2):IF FN R(2)=2 THEN 25400
25305 RANDOMIZE FN TIM(5)
25310 CO%(1,1)=FN SIGN(0)* FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)="":CO%(2,1)=FN SIGN(0)*FN R(7):VA$(2,1)=CHR$(FN VAR(0)):CO%(2,2)=FN SIGN(0)*FN R(7):VA$(2,2)=""
25320 IF VA$(1,1)=VA$(2,1) THEN 25310
25330 RETURN
25400 CO%(1,1)=FN SIGN(0)*FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)="":CO%(2,1)=FN SIGN(0)*FN R(7):VA$(2,1)=CHR$(FN VAR(0)):CO%(2,2)=FN SIGN(0)*FN R(7):VA$(2,2)=""
25410 IF VA$(1,1)=VA$(2,1) THEN 25400
25420 IF INT(RND(1)*1)+1=1 THEN VA$(1,2)=VA$(2,1):RETURN
25430 VA$(2,2)=VA$(1,1):RETURN
25500 ON FN R(10) GOTO 25510,25600,25700,25800,25510,25600,25700,25800,25510,25600
25510 CO%(1,1)=FN SIGN(0)*FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)="":CO%(2,1)=CO%(1,1):VA$(2,1)=VA$(1,1):CO%(2,2)= - CO%(1,2):VA$(2,2)=VA$(1,2)
25520 FOR ZZ=2 TO 5:IF CO%(1,1)/ZZ=CO%(1,1)\ZZ AND CO%(1,2)/ZZ=CO%(1,2)\ZZ THEN 25510
25530 NEXT ZZ
25540 RETURN
25600 CO%(1,1)=FN SIGN(0)*FN R(7):VA$(1,1)=CHR$(FN VAR(0)):CO%(1,2)=FN SIGN(0)*FN R(7):VA$(1,2)=CHR$(FN VAR(0)):CO%(2,1)=CO%(1,1):VA$(2,1)=VA$(1,1):CO%(2,2)=-CO%(1,2):VA$(2,2)=VA$(1,2)
25610 IF VA$(1,1)=VA$(1,2) THEN 25600
25620 FOR ZZ=2 TO 5:IF CO%(1,1)/ZZ=CO%(1,1)\ZZ AND CO%(1,2)/ZZ=CO%(1,2)\ZZ THEN 25600
25630 NEXT ZZ
25640 RETURN
25700 GOSUB 25510:ZZ=FN R(2)+1: IF ABS(ZZ*CO%(1,1))>7 OR ABS(ZZ*CO%(1,2))>7 THEN 25700
25710 IF FN R(2)=2 THEN CO%(1,1)=CO%(1,1)*ZZ:CO%(1,2)=CO%(1,2)*ZZ:RETURN
25720 CO%(2,1)=CO%(2,1)*ZZ:CO%(2,2)=CO%(2,2)*ZZ:RETURN
25800 GOSUB 25600:ZZ=FN R(2)+1:IF ABS (ZZ*CO%(1,1)) > 7 OR ABS(ZZ*CO%(1,2))> 7 THEN 25800
25810 IF FN R(2)=2 THEN CO%(1,1)=CO%(1,1)*ZZ:CO%(1,2)=CO%(1,2)*ZZ:RETURN
25820 CO%(2,1)=CO%(2,1)*ZZ:CO%(2,2)=CO%(2,2)*ZZ:RETURN
30000 '
30010 IF C1$=C2$ THEN C=1:RETURN
30020 IF C1$="" OR C2$="" THEN C=0:RETURN
30030 Z$=C1$:GOSUB 31000:C1$=Z$
30040 Z$=C2$:GOSUB 31000:C2$=Z$
30050 IF C1$=C2$ OR (LEFT$(C1$,1)="0" AND LEFT$(C2$,1)="0" AND VAL (C1$)=0 AND VAL(C2$)=0) THEN C=1 ELSE C=0
30060 IF C=0 AND LEN(C1$)>2 THEN ZZ$=LEFT$(C1$,LEN(C1$)-2)+RIGHT$(C1$,1)+LEFT$(RIGHT$(C1$,2),1):IF ZZ$=C2$ THEN C=1
30070 RETURN
31000 '
31010 ZZ$=""
31020 FOR ZZ=1 TO LEN(Z$):Z1$=MID$(Z$,ZZ,1):IF Z1$=" " OR Z1$="(" OR Z1$=")" OR Z1$="+" THEN 31050
31030 IF ASC(Z1$)>64 AND ASC (Z1$)<91 THEN Z1$=CHR$(ASC(Z1$)+32)
31040 ZZ$=ZZ$+Z1$
31050 NEXT ZZ
31060 Z$=ZZ$
31070 IF Z$="-1" THEN 31170
31100 ZZ$=""
31110 FOR ZZ=1 TO LEN(Z$):Z1$=MID$(Z$,ZZ,1):IF Z1$<>"1" THEN ZZ$=ZZ$+Z1$:GOTO 31160
31120 IF ZZ=1 THEN 31150
31130 IF MID$(Z$,ZZ-1,1)>="0" AND MID$(Z$,ZZ-1,1)<="9" OR MID$(Z$,ZZ+1,1)>="0" AND MID$(Z$,ZZ+1,1)<="9" THEN ZZ$=ZZ$+Z1$
31140 GOTO 31160
31150 IF MID$(Z$,2,1)>="0" AND MID$(Z$,2,1)<="9" THEN ZZ$=ZZ$+Z1$
31160 NEXT ZZ
31170 Z$=ZZ$:RETURN
40000 '
40010 CLS:LOCATE 1,5:PRINT "The FOIL method: How to use it":PRINT TAB(5)STRING$(31,"-"):PRINT
40020 LOCATE 3,1:PRINT " The FOIL method is a technique for":PRINT :PRINT "multiplying binomials. The word FOIL":PRINT
40030 LOCATE ,16:PRINT "F irst":LOCATE ,16:PRINT "O utside":PRINT "is short for: I nside":LOCATE ,16:PRINT "L ast"
40040 LOCATE 12:PRINT " FOIL helps you remember to take the":PRINT :PRINT "products of the first, outside, inside,":PRINT :PRINT "and last terms of the two binomials.":PRINT :PRINT "Once you have found the four products,":PRINT
40045 PRINT "you just add them to get the answer."
40060 GOSUB 12000:T%=2:B%=24:CALL CLR(T%,B%)
40100 VP%=5:HP%=15:CO%(1,1)=3:VA$(1,1)="x":CO%(1,2)=-2:VA$(1,2)="y":CO%(2,1)=1:VA$(2,1)="x":CO%(2,2)=7:VA$(2,2)="":GOSUB 10000
40110 LOCATE 12,1:PRINT STRING$(40,196);:
40120 LOCATE 14,4,0:PRINT "All right, ";N$;", let's try an":PRINT :PRINT "example. I'll start it off.":GOSUB 12000:GOSUB 16000
40150 PRINT " The first letter in FOIL is F, so I":PRINT :PRINT "begin by multiplying the first term of":PRINT :PRINT "each binomial.":PA%=1:GOSUB 11000:GOSUB 12000
40160 GOSUB 16000:PRINT " The product of 3x and x is 3xý. I":PRINT :PRINT "put 3xý on the next line as the first":PRINT :PRINT "term in the solution."
40170 V2%=8:H2%=13:PA%=1:GOSUB 14000:VA$=PR$:CO%=PR%:GOSUB 10500:LOCATE V2%,H2%:PRINT RE$
40180 GOSUB 12000:ER%=1:GOSUB 11000:ER%=0:PA%=2:GOSUB 11000
40190 GOSUB 16000
40200 PRINT " The second letter in FOIL is O. The":PRINT :PRINT "product of the outside terms (3x and 7)":PRINT :PRINT "is 21x.":GOSUB 12000
40210 GOSUB 16000:PRINT " Continue to build the answer by":PRINT :PRINT "adding 21x to 3xý."
40220 LOCATE 7,1:PRINT SPACE$(120);:LOCATE 8,13:PRINT "3xý+21x":GOSUB 12000:ER%=1:GOSUB 11000
40250 L1$="x":L2$="y":GOSUB 16000:PRINT" Now you try finishing the problem.":PRINT :PRINT "We're up to the third letter in FOIL.":GOSUB 12000:PA%=3:ER%=0:GOSUB 11000:GOSUB 15000
40260 GOSUB 16000:PRINT "Good work, ";N$;".":PRINT :PRINT " Notice that I've added -2xy to the":PRINT :PRINT "other two terms. All we have left are":PRINT :PRINT "the last terms.":GOSUB 12000:PA%=4:ER%=0:GOSUB 11000:GOSUB 15000
40300 GOSUB 16000:PRINT " By adding -14y to the sum, we have":PRINT :PRINT "finished all four letters of FOIL. Now":PRINT :PRINT "we try to simplify the product.":GOSUB 12000
40310 GOSUB 16000:PRINT " Since the product has no pairs of":PRINT :PRINT "like terms, it can't be simplified. The":PRINT "product of (3x-2y) and (x+7) is":PRINT :PRINT "3xý+21x-2xy-14y.":GOSUB 12000
40500 T%=2:B%=24:CALL CLR(T%,B%):LOCATE 1,23:PRINT"Why it works ":LOCATE 2,35:PRINT" ";
40510 LOCATE 4,1:PRINT " Now that you know how to multiply":PRINT :PRINT "binomials with FOIL, you should also":PRINT
40520 PRINT "understand why the FOIL method works.":PRINT :PRINT "Let's take another look at the problem":PRINT :PRINT "we just finished to see if we can find"
40521 PRINT :PRINT "out what makes FOIL work.":GOSUB 12000
40530 T%=2:B%=24:CALL CLR(T%,B%):LOCATE 3,1::VP%=3:GOSUB 10000:LOCATE 12,1:PRINT STRING$(40,196)
40540 LOCATE 14:PRINT " The first step is to use the":PRINT :PRINT "distributive law to split the product":PRINT
40550 PRINT "into two parts.":GOSUB 12000
40560 LOCATE 5,8:PRINT "(3x-2y)(x) + (3x-2y)(7)"
40570 GOSUB 16000:PRINT " Notice that I have distributed":PRINT :PRINT "(3x-2y) over (x+7).":GOSUB 12000
40600 GOSUB 16000:PRINT " Now, we use the distributive law":PRINT :PRINT "again on each of the two parts.":GOSUB 12000
40610 LOCATE 7,5:PRINT "[(3x*x)+(-2y*x)]+[(3x*7)+(-2y+7)]"
40620 GOSUB 16000:PRINT " By using the distributive law, we":PRINT :PRINT "have broken the original problem into":PRINT
40630 PRINT "manageable pieces. The only thing left":PRINT :PRINT "to do is the multiplication.":GOSUB 12000
40640 LOCATE 9,11:PRINT "3xý - 2xy + 21x - 14y"
40650 GOSUB 16000:PRINT " That's it, ";N$;". We have":PRINT :PRINT "multiplied two binomials, using the ":PRINT
40660 PRINT "distributive law. Look carefully at":PRINT :PRINT "the result. Does it seem familiar?":GOSUB 12000
40670 GOSUB 16000:PRINT " It should look very familiar. It's":PRINT :PRINT "the same result we found with FOIL,":PRINT
40680 PRINT "except that the second and third terms":PRINT :PRINT "have been exchanged. We can use the":PRINT
40690 PRINT "commutative law to turn FIOL into FOIL."
40700 LOCATE 11,6:PRINT "First Inside Outside Last"
40701 LOCATE 10,6:PRINT " / / \ \"
40710 GOSUB 12000
40720 LOCATE 10,13:PRINT SPC(17);:LOCATE 11,13:PRINT SPC(17);:LOCATE 9,15:PRINT SPC(11);
40730 LOCATE 10,15:PRINT "- 2xy";:LOCATE 8,21:PRINT "+ 21x";:LOCATE 10,21:FOR QQ=1 TO 150:NEXT QQ:FOR ZZ=1 TO 6:LOCATE 8,21-ZZ:PRINT "+ 21x ";:LOCATE 10,14+ZZ:PRINT " - 2xy";:FOR QQ=1 TO 150:NEXT QQ:NEXT ZZ
40750 LOCATE 8,15:PRINT SPC(5);:LOCATE 9,15:PRINT "+ 21x";:LOCATE 10,21:PRINT SPC(5);:LOCATE 9,21:PRINT "-2xy";
40760 LOCATE 11,13:PRINT "Outside Inside";:LOCATE 10,13:PRINT" / \";
40770 GOSUB 16000:PRINT " Now you can see that FOIL gives the":PRINT :PRINT "same result as using the distributive":PRINT
40780 PRINT "and commutative laws.":GOSUB 12000
40785 GOSUB 16000:PRINT" Since we can distribute and commute":PRINT :PRINT "with any binomials, we know that FOIL":PRINT
40790 PRINT "can be used whenever we multiply two":PRINT :PRINT "binomials. FOIL is just a shortcut for":PRINT
40795 PRINT "the distributive and commutative laws.":GOSUB 12000
40800 CLS:LOCATE 1,4:PRINT "The FOIL method: Extra practice":PRINT TAB(4)STRING$(32,"-"):PRINT:L2$=""
40810 PRINT " Before you start working on problems,":PRINT:PRINT "let's try one more example. You'll have"
40820 PRINT "to do most of the work, but I'll help":PRINT :PRINT "at the end. (This problem has a little":PRINT :PRINT "twist to it.)":GOSUB 12000:LOCATE 2,1:T%=2:B%=24:CALL CLR(T%,B%):LOCATE 12,1:PRINT STRING$(40,196);
40830 VP%=5:HP%=16:CO%(1,1)=1:VA$(1,1)="x":CO%(1,2)=7:VA$(1,2)="":CO%(2,1)=1:VA$(2,1)="x":CO%(2,2)=-7:VA$(2,2)="":GOSUB 10000:V2%=8:H2%=16:LOCATE V2%,H2%:PRINT "xý"
40840 GOSUB 16000:PRINT " I've started you off on this problem":PRINT :PRINT "by filling in the product of the first":PRINT :PRINT "terms. Now you try doing the rest of":PRINT :PRINT "the FOIL sequence.":GOSUB 12000
40850 FOR I=2 TO 4:PA%=I:GOSUB 15000:NEXT I
40900 GOSUB 16000:PRINT " Here's the twist. In this product,":PRINT :PRINT "the second and the third terms are like":PRINT :PRINT "terms. To get the final answer, you":PRINT :PRINT "must simplify by combining like terms."
40910 GOSUB 12000
40920 H=34:GOSUB 16000:PRINT "Enter the sum of the like terms: ";:GOSUB 13000:Z$=G$:IF Z$="" THEN 40920
40925 GOSUB 31000:IF Z$="0" OR Z$="0x" THEN 40950
40930 LOCATE 18:PRINT "That's not the correct sum, ";N$;".":PRINT :PRINT "-7x + 7x = 0.":GOSUB 12000:GOTO 40920
40950 LOCATE 11,19:PRINT "xý-49":GOSUB 16000:PRINT "Excellent, ";N$;".":PRINT :PRINT " Notice that in this problem, the sum":PRINT
40960 PRINT "of the like terms is zero, so the middle":PRINT "two terms dropped out completely.":GOSUB 12000
40970 GOSUB 16000:PRINT " In a few cases (like this one), the":PRINT :PRINT "middle terms will cancel. In some":PRINT :PRINT "other cases (like the first practice":PRINT :PRINT "problem), there will be no like terms"
40971 PRINT :PRINT "at all.":GOSUB 12000
40980 GOSUB 16000:PRINT " But in most cases, you will be able":PRINT :PRINT "to combine like terms, although they":PRINT :PRINT "may not cancel each other completely.":GOSUB 12000
40990 CLS:LOCATE 12,12:PRINT "Enjoy the problems!":FOR ZZ=1 TO 2000:NEXT ZZ:RETURN
50000 '
50010 CLS:PRINT:PRINT STRING$(40,219);:FOR X=1 TO 21:PRINT CHR$(219)STRING$(38,32)CHR$(219);:NEXT:LOCATE 23,1:PRINT STRING$(40,219);CHR$(29);
50020 LOCATE 7,9:PRINT "Binomial Multiplication";
50030 LOCATE 11,11:PRINT "Designed by Don Ross";
50040 LOCATE 15,4:PRINT "Microcomputer Workshops Courseware";
50050 LOCATE 17,14:PRINT "Copyright 1984";
50060 FOR ZZ=1 TO 3000:NEXT ZZ
50070 RETURN
52000 '
52010 CLS:PRINT:Z=0:X=0:N$="":DEF SEG=0:POKE 1050,PEEK(1052):DEF SEG:XC=0
52020 PRINT " Please enter your first name (up to":PRINT:PRINT" ten letters) and press
52025 PRINT TAB(10)"Name: ";:LOCATE ,,1
52035 I$=INKEY$:XC=XC+1:IF XC>32000 THEN XC=0
52036 IF I$="" THEN 52035
52040 IF I$=CHR$(13) THEN 52070 ELSE IF I$=CHR$(8) THEN 52075
52045 IF X>=10 THEN 52035 ELSE Z=ASC(I$)
52050 IF (Z<65 OR Z>122) OR (Z>90 AND Z<97) THEN 52035
52055 IF X=0 AND Z>90 THEN Z=Z-32
52060 IF X>0 AND Z<97 THEN Z=Z+32
52065 PRINT CHR$(Z);:N$=N$+CHR$(Z):X=X+1:GOTO 52035
52070 IF X=0 THEN 52035 ELSE LOCATE ,,0:GOTO 52500
52075 IF X=0 THEN 52035 ELSE PRINT CHR$(29)" "CHR$(29);:X=X-1:IF X=0 THEN N$="":GOTO 52035
52080 N$=LEFT$(N$,X):GOTO 52035
52100 CLS:PRINT:PRINT"Hi, "N$"!":PRINT:PRINT:PRINT"This program will help you practice":PRINT:PRINT"multiplying binomials using the FOIL":PRINT:PRINT"method."
52110 GOSUB 12000:RETURN
52500 RANDOMIZE -XC:IF KOLOR=TRUE THEN LOCATE 12,1:PRINT "<"STRING$(38,"-")">";" To center your sceen, use the F9":PRINT:PRINT" and F10 keys.":GOSUB 12000
52510 GOTO 52100
53000 '
53010 ME$(0)="Very Impressive, "+N$
53020 ME$(1)="I see you've been doing your homework."
53030 ME$(2)="Too bad your teacher can't see this."
53040 ME$(3)="Well, we can't all be perfect."
53050 ME$(4)="Okay "+N$+",that was a good try."
53060 ME$(5)="You almost made it on that one."
53070 ME$(6)="These problems are not easy."
53080 ME$(7)="Keep trying, "+N$+". You'll get it."
53090 ME$(8)="Don't be discouraged. You'll get better."
53100 RETURN
55500 GOSUB 55501:GOTO 55510
55501 CLS:LOCATE 1,14:PRINT "Instructions":PRINT TAB(14)STRING$(12,"-"):PRINT:RETURN
55510 PRINT "Okay, ";N$;","
55515 PRINT
55520 PRINT " I will help you learn about":PRINT
55525 PRINT "multiplying binomials using the FOIL":PRINT
55530 PRINT "method.":PRINT
55535 PRINT " There are two ways I can help you.":PRINT
55540 PRINT "The first way is by teaching you some":PRINT
55545 PRINT "things about the FOIL method, and the":PRINT
55550 PRINT "second way is by giving you problems":PRINT
55555 PRINT "to work on."
55560 GOSUB 55805
55565 PRINT " If you choose to let me teach you":PRINT
55570 PRINT "about the FOIL method, we will do three":PRINT
55575 PRINT "things.":PRINT
55580 LOCATE ,4:PRINT "First";:PRINT": I will show you how to use":PRINT
55585 PRINT "FOIL by helping you do a problem.":PRINT
55590 LOCATE ,4:PRINT "Second";:PRINT": I will explain how FOIL":PRINT
55595 PRINT "works.":PRINT
55600 LOCATE ,4:PRINT "Third";:PRINT": We will do another problem":PRINT
55605 PRINT "which will be harder than the first."
55610 GOSUB 55805
55615 PRINT " When you decide to work on problems,":PRINT
55620 PRINT "I will make one up and display it near":PRINT
55625 PRINT "the top of the screen.":PRINT
55630 PRINT " Then you will multiply the binomials":PRINT
55635 PRINT "using the FOIL method. I will ask you":PRINT
55640 PRINT "to enter the product of each pair of":PRINT
55645 PRINT "terms (First, Outside, Inside, Last)":PRINT
55650 PRINT "in order."
55655 GOSUB 55805
55660 PRINT " If you make a mistake, I will help":PRINT
55665 PRINT "you by pointing to the terms you should":PRINT
55670 PRINT "be multiplying.":PRINT
55675 PRINT " Remember : The ";:COLOR 0,7:PRINT "2";:COLOR 7,0:PRINT " key is a special key":PRINT
55680 PRINT "for me. You may use it when you mean":PRINT
55685 PRINT "the number two, as in ";:COLOR 0,7:PRINT "2x";:COLOR 7,0:PRINT "; or you may use"
55690 PRINT "it when you mean the exponent ";CHR$(34);"squared,";CHR$(34)
55695 PRINT "as in ";:COLOR 0,7:PRINT "yý";:COLOR 7,0:PRINT ". When you press ";:COLOR 0,7:PRINT "2";:COLOR 7,0:PRINT ", I will":PRINT
55700 PRINT "know which one you mean."
55705 GOSUB 55805
55710 PRINT " After you finish multiplying the":PRINT
55715 PRINT "binomials, it will be time to simplify":PRINT
55720 PRINT "the product.":PRINT
55725 PRINT " I will ask you to find and add any":PRINT
55730 PRINT "like terms. (For example, if your":PRINT
55735 PRINT "answer is xý+5x-3x-15, then ";:COLOR 0,7:PRINT "5x";:COLOR 7,0:PRINT " and ";:COLOR 0,7:PRINT "-3x";:COLOR 7,0:PRINT:PRINT
55740 PRINT "are like terms, and their sum is ";:COLOR 0,7:PRINT "2x";:COLOR 7,0:PRINT ".)":PRINT
55745 PRINT "If you find a pair of like terms, enter":PRINT
55750 PRINT "their sum; if not, then press ";:COLOR 0,7:PRINT "ENTER";:COLOR 7,0:PRINT "."
55755 GOSUB 55805
55760 PRINT " Once you combine like terms, you will"
55765 PRINT "be done with the problem, and I will":PRINT
55770 PRINT "give you a summary of your errors.":PRINT
55775 PRINT " At this time, you may choose to quit":PRINT
55780 PRINT "or to continue doing problems.":PRINT
55785 PRINT " When you finish a set of problems or":PRINT
55790 PRINT "quit, I will give you a total error":PRINT:PRINT"analysis."
55795 GOSUB 55805:CLS
55800 LOCATE 10,(31-LEN(N$))/2:PRINT "Good luck, ";N$;"!"
55801 FOR X=1 TO 2000:NEXT:RETURN
55805 '
55810 LOCATE 25,9:PRINT "Press ";:COLOR 0,7:PRINT"ENTER";:COLOR 7,0:PRINT" to continue.";
55812 IN$=INKEY$
55815 IN$=INKEY$:IF IN$="" THEN 55815
55820 IF IN$=CHR$(13) THEN 55825 ELSE 55815
55825 '
55830 GOSUB 55501:RETURN
56000 IF KOLOR=TRUE THEN IF INDENT<45 THEN INDENT=INDENT+1:OUT 980,2:OUT 981,INDENT
56010 RETURN
56020 IF KOLOR=TRUE THEN IF INDENT>40 THEN INDENT=INDENT-1:OUT 980,2:OUT 981,INDENT
56030 RETURN
56040 '
56110 DEF SEG
56120 CLRSCRN$=STRING$(35," ")
56130 BASE%=VARPTR(CLRSCRN$)
56140 CLR=PEEK(BASE%+1)+(256*PEEK(BASE%+2))
56150 RESTORE 56210
56160 FOR I%=0 TO 31
56170 READ A%
56180 POKE CLR+I%,A%
56190 NEXT
56200 RETURN
56210 '
56220 DATA &H55,&H8B,&HEC,&H8B,&H76,&H08,&H8A,&H24,&H8A,&HEC,&H8B,&H76,&H06,&H8A,&H24,&H8A
56230 DATA &HF4,&HB8,&H00,&H06,&HB7,&H07,&HB1,&H00,&HB2,&H28,&HCD,&H10,&H5D,&HCA,&H04,&H00
56240 '
56300 TRUE=-1:FALSE=0
56320 DEF SEG=&HB000
56330 POKE 0,&H33
56340 MONO=(PEEK(0)=&H33)
56350 POKE 0,0
56360 MONO=(PEEK(0)=0) AND MONO
56370 DEF SEG=&HB800
56380 POKE 0,&H33
56390 KOLOR=(PEEK(0)=&H33)
56400 POKE 0,0
56410 KOLOR=(PEEK(0)=0) AND KOLOR
56420 IF MONO AND KOLOR GOTO 56480
56430 IF KOLOR GOTO 56560
56440 IF MONO GOTO 56620
56460 CLS:LOCATE 1,2,0:PRINT "SOMETHING WRONG -- NO ADAPTERS ..."
56470 END
56480 '
56490 CLS:WIDTH 40:BEEP:LOCATE 1,2,0:PRINT "Choose a display ..."
56500 LOCATE 4,2,0:PRINT "C for color, M for monochrome"
56510 I$=INKEY$:IF I$="" GOTO 56510
56520 IF I$="C" OR I$="c" GOTO 56560
56530 IF I$="m" OR I$="M" GOTO 56620
56540 GOTO 56490
56560 DEF SEG=&H40:I=PEEK(&H10):POKE &H10,(I AND &HCF) OR &H20
56570 SCREEN 1:BLOAD"CBSLOGO.PIC":FOR IIX=1 TO 7000:NEXT:SCREEN 0,0,0,0:WIDTH 40:LOCATE ,,0,6,7
56580 KOLOR=TRUE:MONO=FALSE:X=12:INDENT=45:SEGMENT=&HB800
56590 COLOR 7,0,0
56600 GOTO 56660
56620 DEF SEG=0:I=PEEK(&H410):POKE &H410,I OR &H30
56630 SCREEN 0,0,0,0
56632 LOCATE 9,28:PRINT STRING$(25,219):LOCATE 17,28:PRINT STRING$(25,219):FOR IIX=10 TO 16:LOCATE IIX,28:PRINT CHR$(219);SPACE$(23);CHR$(219):NEXT:LOCATE 12,39:PRINT"CBS":LOCATE 14,37:PRINT"PRESENTS":FOR IIX=1 TO 5000:NEXT
56634 WIDTH 40:LOCATE ,,0,12,13
56635 OUT 948,2:OUT 949,62
56640 KOLOR=FALSE:MONO=TRUE:X=26:SEGMENT=&HB000
56650 COLOR 7,0
56660 RETURN
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/