home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Educational
/
EQUATIONS-1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
8KB
|
218 lines
1 GOTO112
2 PRINT" ":RETURN
3 POKE198,.:UR$="":UI$=""
4 IFUL=.THENUL=80
5 POKEUC,.
6 GETUI$:IFUI$=""THEN6
7 POKESI+4,33:POKESI+1,ASC(UI$):FORWV=1TO10:NEXT:POKESI+1,.
8 IFUI$=CHR$(13)ANDLEN(UR$)>=1THENPOKEUC,1:PRINT" [157]";:UF=.:PRINT:RETURN
9 IFUI$=CHR$(20)THEN12
10 IFLEN(UR$)=>ULTHEN6
11 GOSUB15:UR$=UR$+UI$:PRINTUI$;:GOTO6
12 IFLEN(UR$)<1THEN6
13 UR$=LEFT$(UR$,LEN(UR$)-1)
14 PRINT"[157] [157][157]";:GOTO6
15 IFLEN(US$)=.THEN18
16 FORUS=1TOLEN(US$):IFUI$<>MID$(US$,US,1)THENNEXT:UI$=""
17 RETURN
18 IFASC(UI$)=46THENRETURN
19 IFUI$=CHR$(32)THENRETURN
20 IFASC(UI$)<48ORASC(UI$)>57THEN22
21 RETURN
22 IFASC(UI$)<65ORASC(UI$)>90THEN24
23 RETURN
24 IFASC(UI$)<193ORASC(UI$)>218THENUI$="":RETURN
25 IFPEEK(UT)=UU%THENUI$=CHR$(ASC(UI$)-128):RETURN
26 RETURN
27 UI$="":RETURN
28 PRINT"[147]":POKEUT,UU%:POKE53281,9:POKE53280,8
29 PRINT""SPC(16)"MENU"
30 PRINT" --------------------------------------"
31 PRINTSPC(7)"1. BEGIN EQUATION"
32 PRINTSPC(7)"2. STUDENT INSTRUCTIONS"
33 PRINTSPC(7)"3. TEACHER INSTRUCTIONS"
34 PRINTSPC(7)"4. QUIT"
35 PRINT" --------------------------------------"
36 PRINTSPC(7)"PRESS A NUMBER KEY (1-4) ";
37 UL=1:US$="1234":GOSUB3:US$="":ONVAL(UR$)GOSUB113,40,70,39
38 GOTO28
39 POKE53281,.:POKE53280,.:PRINT"[147]":END
40 PRINT"[147]":POKEUT,UL%:POKE53281,.:POKE53280,.
41 UP=.:UG$="[211]TUDENT [201]NST":GOSUB105
42 PRINTSPC(6)"[217]OU WILL BE ASKED TO SOLVE":PRINT
43 PRINT" EQUATIONS WITH ONE VARIABLE OF THE"
44 PRINT" TYPE 3X - 5 = 7. [212]HE OBJECT IS"
45 PRINTSPC(6)"[163][163][163][163][163][163][163][163][163][163]"
46 PRINT" QUICK MENTAL SOLUTION OF THE EQUATION"
47 PRINT" BY DETERMINING THE VALUE FOR X THAT":PRINTSPC(30)"[163]"
48 PRINT" MAKES THE EQUATION TRUE.":PRINT
49 PRINTSPC(5)"[217]OU WILL BE GIVEN 3 ATTEMPTS":PRINT
50 PRINT" BEFORE THE CORRECT ANSWER IS GIVEN.":GOSUB102:UP=2:GOSUB105
51 PRINT" [201]F YOU FAIL IN THE 3 ATTEMPTS":PRINT
52 PRINT" YOU CAN SEE A COMPLETE SOLUTION OF":PRINT" THE PROBLEM."
53 PRINTSPC(5)"[212]HE FOLLOWING IS AN EXAMPLE "
54 PRINT" SOLUTION WORKED OUT:"
55 PRINT" [150][208]ROBLEM:"SPC(7)"3X - 5 = 7"
56 PRINT" [159][193]DD 5 TO EACH SIDE[146]"
57 PRINT" [150][210]ESULT:"SPC(9)"3X = 12"
58 PRINT" [159][196]IVIDE EACH SIDE BY 3[146]"
59 PRINT" [150][210]ESULT:"SPC(10)"X = 4":GOSUB102:UP=3:GOSUB105
60 PRINTSPC(5)"[211]OME PROBLEMS HAVE THE VARIABLE"
61 PRINT" TERM ON THE RIGHT SIDE OF THE EQUATION"
62 PRINT" AND OCCASIONALLY THERE WILL BE A"
63 PRINT" VARIABLE ON BOTH SIDES. [199]OOD LUCK!"
64 PRINTSPC(5)"[215]HEN YOU FINISH, YOUR SCORE IS"
65 PRINT" THE NUMBER CORRECT ON THE FIRST TRY.":GOSUB102:UP=4:GOSUB105
66 PRINT" [206]OTE:[157][212]O ADVANCE FROM ONE QUESTION"
67 PRINT" TO THE NEXT PRESS THE [153][211][208][193][195][197] BAR."
68 PRINTSPC(5)"[201]F AT ANY TIME YOU WISH TO RETURN"
69 PRINT" TO THE [158][205][197][206][213] PRESS [153][209] [210][197][212][213][210][206].":GOTO102
70 PRINT"[147]":POKEUT,UL%:POKE53281,2:POKE53280,10
71 UP=.:UG$="[212]EACHER [201]NST":GOSUB105
72 PRINTSPC(6)"[212]O THE BEST OF OUR KNOWLEDGE,"
73 PRINT" THIS PROGRAM IS IN THE PUBLIC"
74 PRINT" DOMAIN. [201]F THIS IS NOT THE CASE"
75 PRINT" PLEASE CONTACT:"
76 PRINTSPC(6)"[195]OMMODORE [194]USINESS [205]ACHINES"
77 PRINTSPC(10)"3370 [208]HARMACY [193]VE.
78 [153][166]10)"ATNGINCOURT, (null)NTARIO"
79 [153][166]10)"LENANADA (null)1(null) 2(null)4"
80 [153][166]10)"(416) 499-4292"
81 UP[178]1:[141]102:[141]105
82 [153][166]5)"(null)ROGRAM (null)AME: VALQUATION
83 PRINTSPC(5)"[215]RITTEN [194]Y : [195]. [199]. [193]NDERSON
84 [153][166]5)"(null)PGRADED PEEKY : STR$. ATNRTHURS
85 PRINTSPC(5)"[212]HIS PROGRAM WILL RUN ON ANY
86 [153][166]9)"LEN(null)(null)(null)(null)STR$(null)(null)VAL 64 LEN(null)(null)(null)(null)(null)VAL(null)":[137]102
87 [153]"LOAD";:[151]UT,UU%:[151]53280,14:[151]53281,6
88 [129]I[178]1[164]38:[153]"SPC(WAIT";:[130]
89 [129]I[178]1[164]22:[153]"CMDSPC(WAIT";:[130]
90 [129]I[178]1[164]37:[153]"CMDCMDSPC(WAIT";:[130]
91 [129]I[178]1[164]22:[153]"ONCMDSPC(WAIT";:[130]
92 [153]""[166]18)"STEP WAIT
93 PRINTSPC(18)" [146] [146][169]
94 [153][166]18)" WAIT TAB((null)
95 PRINTSPC(18)"[223] [146]
96 [153][166]12)"C O M M O D O R E
97 PRINTSPC(15)"EDUCATIONAL
98 [153][166]16)"SOFTWARE
99 PRINTLEFT$(UD$,24)SPC(9)"PRESS SPACE BAR OR WAIT[146]":I=.:POKE198,.
100 GETA$:IFA$<>" "THENI=I+1:IFI<250THEN100
101 T1$="":T2$="":T3$="":T4$="":I=.:GOSUB202:GOTO28
102 PRINTLEFT$(UD$,24)SPC(6)"PRESS SPACE BAR TO CONTINUE[146]":POKE198,.
103 GETUI$:IFUI$<>" "THEN103
104 POKESI+4,17:POKESI+1,35:FORWV=1TO10:NEXT:POKESI+1,.:RETURN
105 UP=UP+1
106 PRINT"[147]"LEFT$(UT$+UP$,21)RIGHT$(UP$+UG$+STR$(UP),18)
107 PRINT" --------------------------------------":RETURN
108 UB=1024:U1=209:U2=210:U3=211:U4=214:UC=204
109 UT=53272:UU%=21:UL%=23:UP%=2139:UM=1024:UD$=""
110 UP$=" ":UT$=" [197][209][213][193][212][201][207][206] "
111 SI=54272:FORX=SITOSI+24:POKEX,.:NEXT:POKESI+24,10:POKESI+6,240:RETURN
112 DIMP$(10),NP$(10):GOSUB108:GOSUB87:GOTO28
113 PRINT"[147]";:POKEUT,UL%:POKE53281,.:POKE53280,.:RESTORE:X0=15
114 FORX=1TO10:READP$(X):NEXT:FORX=1TO10:READNP$(X):NEXT
115 PRINT"[147]":UP=.
116 PRINT""SPC(6)"[200]OW MANY PROBLEMS WOULD"
117 PRINTSPC(6)"YOU LIKE TO SOLVE? [157][157]";
118 US$="1234567890Q":UL=2:GOSUB3:IFUR$="Q"THENRETURN
119 E=VAL(UR$):IFE>0THEN122
120 PRINT" [159] [210]ESPONSE MUST BE GREATER THAN ZERO [146]"
121 FORWV=1TO1000:NEXT:PRINT"[145] ":GOTO116
122 R=.:FORI=1TOE:PRINT"[147]"
123 X=INT(RND(1)*21)-10:IFX=.THEN123
124 Y=INT(RND(1)*41)-20:Z=INT(RND(1)*41)-20:T=INT(RND(1)*10)+1
125 IFT-X=.ORT+X=.THEN123
126 D=X+T:F=X-T:A$=STR$(X):D$=STR$(T):E$=STR$(D):F$=STR$(F):L$=A$
127 IFX-T=-1THENF$="-"
128 IFX+T=-1THENE$="-"
129 IFX-T=1THENF$=" "
130 IFX+T=1THENE$=" "
131 IFX=-1THENA$="-"
132 IFX=1THENA$=" "
133 IFT=1THEND$=" "
134 B$=STR$(Y):C$=STR$(Z):IF(Z-Y)/X=INT((Z-Y)/X)THEN136
135 GOTO123
136 UG$="[209]UESTION #":UP=I-1:GOSUB105:PRINT"";:B=INT(RND(1)*3)+1
137 IFY<0THEN142
138 ONBGOTO139,140,141
139 PRINTA$"X +"B$" ="C$;:GOTO146
140 PRINTC$" ="A$"X +"B$;:GOTO146
141 PRINTE$"X +"B$" ="C$" +"D$"X";:GOTO146
142 B$=STR$(-Y):ONBGOTO143,144,145
143 PRINTA$"X -"B$" ="C$;:GOTO146
144 PRINTC$" ="A$"X -"B$;:GOTO146
145 PRINTF$"X -"B$" ="C$" -"D$"X";:GOTO146
146 FORM=1TO3
147 W=UP:PRINTTAB(25)"X = ";:US$="1234567890-Q":UL=3:GOSUB3:C=VAL(UR$)
148 IFUR$="Q"THENRETURN
149 UP=W:PRINT:IFC<>(Z-Y)/XTHEN153
150 GOSUB2:K=INT(RND(0)*10)+1:PRINT"[145]"TAB((40-LEN(P$(K)))/2)P$(K)
151 GOSUB196:GOSUB102:IFC=(Z-Y)/XANDM=1THENR=R+1
152 GOTO160
153 GOSUB2:K=INT(RND(0)*10)+1:PRINT"[145]"TAB((40-LEN(NP$(K)))/2)NP$(K)
154 GOSUB199:FORWV=1TO500:NEXT:PRINT"[145] "
155 PRINT"[145][145][145][145][145]"TAB(26)" [157][157][157][157][157][157][157][157][157]";:NEXTM
156 PRINT""SPC(8)"[212]HE ANSWER IS "(Z-Y)/X"[157]. "
157 PRINT" [150][215]OULD YOU LIKE TO SEE THE SOLUTION? ";
158 US$="YNQ":UL=1:GOSUB3:M$=UR$:IFM$="Y"THENGOSUB169
159 IFM$="Q"THENRETURN
160 NEXTI:UG$="[211]CORE ":UP=.:GOSUB105
161 PRINT" [150][217]OU HAVE"R"[150]CORRECT OUT OF"E"[150]TRIES."
162 PRINT" [150][215]OULD YOU LIKE TO TRY AGAIN? ";
163 US$="YNQ":UL=1:GOSUB3:X$=UR$:IFX$="Y"THEN115
164 RETURN
165 DATA"[214]ERY GOOD","[212]HAT'S RIGHT","[195]ORRECT","[206]ICE WORK","[197]XCELLENT"
166 DATA"[212]ERRIFIC","[211]UPER","[198]ANTASTIC","[199]REAT","[217]ES"
167 DATA"[211]ORRY","[212]OO BAD","[201]NCORRECT","[206]O","[215]RONG"
168 DATA"[194]UMMER","[217]OU BLEW IT","[193]RE YOU KIDDING","[211]O SAD","[200]A HA HA"
169 PRINT"[147]":ONBGOTO170,180,188
170 IFY<0THEN173
171 PRINT" [150][208]ROBLEM: "A$"X +"B$" ="C$
172 PRINTSPC(7)"[159][211]UBTRACT "B$" FROM EACH SIDE[146]":GOTO176
173 B$=STR$(-Y)
174 PRINT" [150][208]ROBLEM: "A$"X -"B$" ="C$
175 PRINTSPC(10)"[159][193]DD "B$" TO EACH SIDE[146]"
176 W=Z-Y:G$=STR$(W)
177 PRINT" [150][210]ESULT:"SPC(8)A$"X ="G$:PRINT:IFX=1THEN195
178 PRINTSPC(9)"[159][196]IVIDE EACH SIDE BY "L$"":S=W/X:S$=STR$(S)
179 PRINT" [150][210]ESULT:"SPC(9)"X ="S$:GOTO195
180 IFY<0THEN183
181 PRINT" [150][208]ROBLEM: "C$" ="A$"X +"B$
182 PRINTSPC(7)"[159][211]UBTRACT "B$" FROM EACH SIDE[146]":GOTO185
183 B$=STR$(-Y):PRINT" [150][208]ROBLEM: "C$" ="A$"X -"B$
184 PRINTSPC(10)"[193]DD "B$" TO EACH SIDE[146]"
185 W=Z-Y:G$=STR$(W):PRINT" [150][210]ESULT:"SPC(8)G$" ="A$"X":IFX=1THEN195
186 PRINTSPC(9)"[159][196]IVIDE EACH SIDE BY "L$"":S=W/X:S$=STR$(S)
187 PRINT" [150][210]ESULT:"SPC(9)S$" = X":GOTO195
188 IFY<0THEN192
189 PRINT" [150][208]ROBLEM: "E$"X +"B$" ="C$" +"D$"X"
190 PRINTSPC(7)"[159][211]UBTRACT "D$"X FROM EACH SIDE[146]"
191 PRINT" [150][210]ESULT: "A$"X +"B$" ="C$:PRINT:GOTO172
192 PRINT" [150][208]ROBLEM: "F$"X -"B$" ="C$" -"D$"X"
193 PRINTSPC(10)"[159][193]DD "D$"X TO EACH SIDE"
194 PRINT" [150][210]ESULT: "A$"X -"B$" ="C$:PRINT:GOTO175
195 GOTO102
196 X0=X0+2+8*(X0=23):POKESI+4,X0:FORDV=1TO3:FOREZ=.TO5:POKESI+15,33
197 FORWV=(10+EZ*10)TO(10+EZ*20)STEP11:POKESI+1,WV:NEXTWV,EZ,DV:POKESI+1,.
198 POKESI+1,.:POKESI+15,.:RETURN
199 POKESI+4,.:POKESI+13,249:POKESI+11,23:FORDV=1TO3:POKESI+1,INT(RND(6)*25)+5
200 FOREZ=.TO183STEP17:POKESI+8,EZ:NEXT:FOREZ=183TO.STEP-10:POKESI+8,EZ
201 NEXTEZ,DV:POKESI+11,22:RETURN
202 SI=54272:FORX=SITOSI+24:POKEX,.:NEXT:POKESI+24,10:POKESI+6,240
203 POKE53280,.:POKE53281,.:PRINT"[147]"SPC(11)"[158][194]ROUGHT TO YOU BY"
204 PRINTSPC(7)"[197]VANSVILLE [208]RINTING [195]ORP.":PRINTSPC(7)"";
205 PRINT"[205]ODIFIED BY: [211]EAN [215]INSTEAD":POKESI+4,33
206 FOREZ=1TO33:PRINT""SPC(7)"[152][197]VAN[152]SVIL[152]LE [208]R[152]INTI[152]NG [195]O[152]RP."
207 PRINTSPC(20)"[152][211]EAN [152][215]INS[152]TEAD"
208 POKESI+1,8+EZ*.5:FORWV=1TO10:NEXT:POKESI+1,.:FORWV=1TO10:NEXT
209 PRINT""SPC(7)"[152][197]VA[152]NSVI[152]LLE [208][152]RINT[152]ING [195][152]ORP."
210 PRINTSPC(20)"[152][211]EA[152]N [215]IN[152]STEA[152]D"
211 POKESI+1,20/(EZ/4):FORWV=1TO10:NEXT:POKESI+1,.:FORWV=1TO10:NEXT
212 PRINT""SPC(7)"[197]V[152]ANSV[152]ILLE [152][208]RIN[152]TING [152][195]ORP[152]."
213 PRINTSPC(20)"[211]E[152]AN [215]I[152]NSTE[152]AD"
214 POKESI+1,9+EZ/6:FORWV=1TO10:NEXT:POKESI+1,.:FORWV=1TO10:NEXT
215 PRINT""SPC(7)"[197][152]VANS[152]VILL[152]E [208]RI[152]NTIN[152]G [195]OR[152]P."
216 PRINTSPC(20)"[211][152]EAN [215][152]INST[152]EAD";
217 POKESI+1,50-EZ*1.5:FORWV=1TO10:NEXT:POKESI+1,.:FORWV=1TO10:NEXTWV,EZ:RETURN