home *** CD-ROM | disk | FTP | other *** search
/ The CIA World Factbook 1992 / k3bimage.iso / sel / 04 / 0047 / mathpar.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1991-12-02  |  15.9 KB  |  346 lines

  1. 2  REM --------SOLVING MATH WORD PROBLEMS--------------------------
  2. 1000  REM  WORDIES - a word problem generating program
  3. 1010  REM  by Michail Potts    Printed in Creative Computing 10-81
  4. 1020  REM  PO Box 88 Caspar Ca 95420 (707) 964 0375
  5. 1030  REM  ADAPTED TO CCII BY PATRICK LEABO
  6. 1040  REM ADAPTED TO IBM PC BY PATRICK LEABO
  7. 1042  REM ADAPTED FOR PCjr BY G.WEST, ALLENDALE SC 29810 10/10/84
  8. 1043  RANDOMIZE TIMER
  9. 1044  DEF SEG=0:POKE 1047,0
  10. 1045  ON ERROR GOTO 5000
  11. 1050  POKE 106,0:SCREEN 0,1:KEY OFF:WIDTH 80:COLOR 15,1,1:CLS
  12. 1055  DEFINT A-Z:COMMON MENU
  13. 1060  DIM T$(47),M(42,8),O(14),XP(15),YP(15)
  14. 1080  SP$= "                    "
  15. 1090  SS$= "                                       "
  16. 1100  GOTO 1120
  17. 1110  PRINT :CLS:PRINT TAB( 20)"*** WORDIES *** ":RETURN
  18. 1120  GOSUB 1110:PRINT TAB( 12)"A word-problem generating game":PRINT :PRINT
  19. 1130  PRINT "Word problems will be created with the information":PRINT "that you provide when asked."
  20. 1135  PRINT
  21. 1150  PRINT TAB(6);"1) ADDITION":PRINT TAB(6);"2) SUBTRACTION":PRINT TAB(6);"3) MULTIPLICATION":PRINT TAB(6);"4) DIVISION":PRINT
  22. 1160  PRINT TAB( 6);:PRINT "PRESS THE NUMBER FOR YOUR CHOICE! ";:WHILE I$="":I$=INKEY$:WEND:NL= VAL (I$):PRINT NL:PRINT :PRINT
  23. 1170  IF NL<1 THEN NL=4
  24. 1180  IF NL> 4 THEN NL= 4
  25. 1181  PRINT "This program will make up problems using the numbers you give it.":PRINT "It cannot use a number larger that 443 or smaller than 0; so don't":PRINT "use any of those.  Type the largest number you would like to work with"
  26. 1182  PRINT "and press the <ENTER> key."
  27. 1190  PRINT:PRINT TAB( 10);:INPUT "Largest number in any problem";NMX
  28. 1200  IF NMX> 443 THEN PRINT "443 IS THE MAXIMUM. TRY AGAIN!":GOTO 1190
  29. 1210  IF NMX< 1 THEN PRINT "Greater than zero please. TRY AGAIN!":GOTO 1190
  30. 1211  CLS
  31. 1212  PRINT "In the problems you will do, we will use things that you":PRINT "give us.  Whenever, the computer asks for an object or a name,":PRINT "type that object or name and press the <ENTER> key.":PRINT
  32. 1220  PRINT :PRINT TAB( 15)"I need 5 random objects:":PRINT :FOR N= 0 TO 4
  33. 1230  PRINT TAB( 20);N+1;":";
  34. 1231  INPUT " ",RO$(N)
  35. 1250  NEXT :GOTO 1280
  36. 1260  NL= 4:RO$(1)= "snail":RO$(2)= "bookend":RO$(3)= "wood stove":RO$(4)= "rocking chair"
  37. 1270  RO$(5)= "tractor":NMX= 9
  38. 1280  P1$= "Kelly":PS$= "her ":SX$= "she"
  39. 1290  AR= 0:WA= 0:NR= 0:GOSUB 1110:PRINT "  This program makes up word problems ...with your help. The"
  40. 1300  PRINT "screen will ask for names of people and for things to use":PRINT "in the problems it creates."
  41. 1310  PRINT :PRINT "  The computer will reject an answer with more than":PRINT "16 characters, OR that it thinks ";
  42. 1320  PRINT "is nonsense.":PRINT :PRINT "   Have a good time. Press ENTER when you're ready to go."
  43. 1330  I$= INKEY$:IF I$="" THEN 1330
  44. 1340  IF ASC(I$)<> 13 THEN 1330
  45. 1350  GOSUB 1110
  46. 1360  PRINT "Please type your name and press <ENTER>:":PRINT "(Use a capital letter followed by lowercase letters.)"
  47. 1370  INPUT " ",T$
  48. 1380  A$= T$:GOSUB 2880:IF CF= 1 THEN 1410
  49. 1390  PRINT :PRINT "Whatever you want me to call you, you're a person, and the":PRINT "names of persons begin with a ";
  50. 1400  PRINT "CAPITAL letter. Remember the":PRINT "SHIFT key, and please tell me again.":PRINT :GOTO 1360
  51. 1410  FP= 0:GOSUB 1490:N= INT(RND(1)* 3)+ 1:ON  N GOTO 1420,1440,1440:REM  FLOW CONTROL - GET OPER TYPE
  52. 1420  GOSUB 3010:IF NF= 0 THEN 1440:REM  GET NAME(S)
  53. 1430  PRINT "I detect nonsense! Please try again.":PRINT :GOTO 1420
  54. 1440  GOSUB 1530:REM  GET NUMBERS
  55. 1450  GOSUB 3130:REM  GET OBJECT NAME, PRINT FIRST PARA
  56. 1460  IF NQ< > CA THEN 1680
  57. 1470  K9= 0:LOCATE 18,1:PRINT "----------------------------------------------------------" :PRINT TAB(12);"That's RIGHT, ";A$;".":GOTO 2230:REM  RECORD KEEPING
  58. 1480  GOTO 1410
  59. 1490  REM  SETS OPERATION TYPE5
  60. 1500  NO= INT(NL* RND(1)+ 1):REM  1=+ 2=- 3=* 4=/
  61. 1510  RETURN 
  62. 1520  ON  NO GOTO 1530,1530,1540,1540:REM  NUMBER CRUNCHING
  63. 1530  N1= INT(NMX* RND(1)+ 1):ON  NO GOTO 1570,1580,1520,1520
  64. 1540  N1= INT(NMX/ 2* RND(1)):N2= INT(NMX/ 3* RND(1)):IF N2= 0 THEN N2= 1
  65. 1550  ON  NO GOTO  1520,1520,1600,1560
  66. 1560  N1= N1* N2:GOTO 1600
  67. 1570  N2= INT(NMX* RND(1)):GOTO 1600
  68. 1580  N2= INT(N1* RND(1)):IF N2> 1 THEN 1600
  69. 1590  N2= INT(N2+ 0.5):GOTO 1600
  70. 1600  RETURN 
  71. 1610  PRINT "I need the name of an object.";
  72. 1615  INPUT " ",T$
  73. 1630  ON NF GOTO  1640,1610
  74. 1650  XN= INT(3* RND(1)+ 1):ON  NX GOTO 1660,1670,1660
  75. 1660  OB$= T$
  76. 1670  N= INT(5* RND(1)):RO$(N)= T$:RETURN
  77. 1675  PRINT "----------------------------------------------------------"
  78. 1680  PRINT:PRINT:PRINT "----------------------------------------------------------"
  79. 1682  WA= WA+ 1:PRINT :PRINT " -<WRONG ANSWER>- ":PRINT "DO YOU WANT HELP ? ":PRINT "Y for YES or N for NO."
  80. 1685  PRINT "----------------------------------------------------------"
  81. 1690  I$= INKEY$:IF I$="" THEN 1690
  82. 1700  IF I$< > "N" THEN 1730
  83. 1710  K9= K9+ 1:IF K9= 3 THEN PRINT :PRINT "Sorry, you only get three trys.":GOTO 1740
  84. 1720  WA= WA- 1:PRINT :PRINT "********************************************":GOSUB 3680:GOTO 1460
  85. 1730  PRINT "  ...OKay:"
  86. 1740  PRINT "   What number do you start with";:INPUT NQ:IF NQ= N1 THEN 1760
  87. 1750  FP= FP+ 1:PRINT "No. Read the first part again carefully:":PRINT "   ";SQ$:GOTO 1740
  88. 1760  PRINT "   What is the second number";:INPUT NQ:IF NQ= N2 THEN 1780
  89. 1770  FP= FP+ 10:PRINT "No. Read the second part again carefully:":PRINT "    ";S2$:GOTO 1760
  90. 1780  PRINT "   What do you do with the numbers:  add";:IF NL= 1 THEN 1820
  91. 1790  PRINT ", subtract";:IF NL= 2 THEN 1820
  92. 1800  PRINT ",":PRINT "      multiply";:IF NL= 3 THEN 1820
  93. 1810  PRINT ",or divide";
  94. 1820  PRINT "?"
  95. 1830  I$= INKEY$:IF I$="" THEN 1830
  96. 1840  IF (NO= 1)* (I$= "Y") THEN PRINT "A";:GOTO 1900
  97. 1850  IF I$= "A" OR I$="a" OR I$="y" OR I$="Y" THEN 1900
  98. 1860  IF I$= "S" OR I$="s" THEN 1910
  99. 1870  IF I$= "M" OR I$="m" THEN 1920
  100. 1880  IF I$= "D" OR I$="d" THEN 1930
  101. 1890  PRINT "Try that, again, ";A$;".":GOTO 1830
  102. 1900  PRINT "Add":NQ= 1:GOTO 1940
  103. 1910  PRINT "Subtract":NQ= 2:GOTO 1940
  104. 1920  PRINT "Multiply":NQ= 3:GOTO 1940
  105. 1930  PRINT "Divide":NQ= 4
  106. 1940  IF NQ= NO THEN 2030
  107. 1950  FP= FP+ (NQ* 100):PRINT "No. To do this problem, you need to ";:ON NO GOTO 1960,1970,1980,2000
  108. 1960  PRINT " add.":PRINT "The clue: ";V$;" more.":PRINT "Don't you add";:GOTO 2010
  109. 1970  PRINT " subtract.":PRINT "The key words: ";V$:PRINT "So you subtract, right?":GOTO 2010
  110. 1980  PRINT " multiply.":PRINT "The words ";CHR$(34);V$;CHR$(34);" are the key.":PRINT "If you see equal groups, "
  111. 1990  PRINT "and you need to know how many they":PRINT "total, isn't it easier to multiply";:GOTO 2010
  112. 2000  PRINT "divide.":PRINT "You need to know how many ";V$;",":PRINT "so you divide";N1;" into";N2;" groups ..Right";
  113. 2010  INPUT Q$:IF  LEFT$(Q$,1)= "Y" THEN 2030
  114. 2020  PRINT "Well, ";A$;", I think the answer is YES."
  115. 2030  PRINT "  So do this problem:";"  ";N1;" ";:ON  NO GOTO 2040,2050,2060,2070
  116. 2040  CA= N1+ N2:PRINT "+ ";:GOTO 2080
  117. 2050  CA= N1- N2:PRINT "- ";:GOTO 2080
  118. 2060  CA= N1* N2:PRINT "* ";:GOTO 2080
  119. 2070  CA= N1/ N2:PRINT "/ ";
  120. 2080  PRINT N2;" = ?";
  121. 2090  MF= 0:GOSUB 2930
  122. 2100  PRINT I$;:T$= I$:GOSUB 2930
  123. 2110  IF MF= 1 THEN 2130
  124. 2120  T$= T$+ I$:PRINT I$;:GOSUB 2930:GOTO 2110
  125. 2130  NQ= VAL (T$):IF NQ= CA THEN 2190
  126. 2140  PRINT :PRINT :PRINT "   You need to work on your ";:ON NO GOTO 2150,2160,2170,2180 REM 5
  127. 2150  PRINT "addition ";:FP= FP+ 1000:GOTO 2200
  128. 2160  PRINT "subtraction ";:FP= FP+ 2000:GOTO 2200
  129. 2170  PRINT "multiplication ";:FP= FP+ 3000:GOTO 2200
  130. 2180  PRINT "division ";:FP= FP+ 4000:GOTO 2200
  131. 2190  PRINT :PRINT "Yes, you have it now!!";:GOTO 2220
  132. 2200  PRINT "facts."
  133. 2210  PRINT "The correct answer is ";CA;"."
  134. 2220  FOR N= 0 TO 2000:NEXT :NH= NH+ 1:GOTO 2290
  135. 2230  AR= AR+ 1:PRINT TAB(11);AR;" right answer";:IF AR= 1 THEN 2250
  136. 2240  PRINT "s";
  137. 2250  I= 0:PRINT " so far.":PRINT 
  138. 2260  PRINT "              PRESS <ENTER> TO  CONTINUE"
  139. 2270  PRINT"                  any other key to quit."
  140. 2275  PRINT "----------------------------------------------------------"
  141. 2280  I$=INKEY$:IF I$ = "" THEN 2280 ELSE IF I$<> CHR$(13) THEN 2550
  142. 2290  ON  NO GOTO 2300,2310,2320,2330
  143. 2300  OP$= "+":GOTO 2340
  144. 2310  OP$= "-":GOTO 2340
  145. 2320  OP$= "*":GOTO 2340
  146. 2330  OP$= "/"
  147. 2340  NN=LEN(OB$):NN=20-NN:R$(NR)=OB$+"s :"+LEFT$(SP$,NN)+STR$(N1)+OP$+STR$(N2)+" ="+STR$(CA)
  148. 2350  IF FP= 0 THEN 2370
  149. 2360  R$(NR)= R$(NR)+ "       <"+ STR$(FP)
  150. 2370  IF NR= 9 THEN 2390
  151. 2380  NR= NR+ 1:PRINT "==============================================================":GOTO 1410
  152. 2390  NT= 9
  153. 2400  CLS:PRINT :PRINT "This is what you've done.":PRINT
  154. 2410  T$= "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%":GOSUB 2990
  155. 2430  T$= "":GOSUB 2990
  156. 2440  T$= A$+ " has gotten"+ STR$(AR)+ " right,"+ STR$(WA)+ " wrong,":GOSUB 2990
  157. 2450  IC=INT(100* (AR/ (AR+ WA))):T$= "for a score of"+ STR$(IC)+ "%   ":IF IC< 95 THEN 2470
  158. 2460  T$= T$+ "VERY "
  159. 2470  IF IC< 90 THEN 2490
  160. 2480  T$= T$+ "WELL DONE, "+ A$+"."
  161. 2490  GOSUB 2990:T$="":GOSUB 2990:T$= "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%":GOSUB 2990
  162. 2500  PRINT :PRINT"Press ENTER for more":PRINT "or Q to quit."
  163. 2510  I$=INKEY$:IF I$="" THEN 2510 ELSE IF I$< > "Q" AND  I$ <> "q" THEN 2540
  164. 2520  PRINT "   It's been a pleasure doing business with you, ";A$
  165. 2530  PRINT "Please come again.":FOR N= 1 TO 1000:NEXT :COLOR 7,0:CLS:END
  166. 2540  CLS:FOR NR= 0 TO 9:R$(NR)= "":NEXT :NR= 0:GOTO 1410
  167. 2550  PRINT :PRINT "Quitting time, you say. Good.":NT= NR- 1:GOTO 2400
  168. 2560  REM 
  169. 2570  REM 2 KEYBOARD5
  170. 2580  REM 
  171. 2585  DEF SEG=0:POKE 1047,0
  172. 2590  NN= LEN(OB$):NN= 20- NN:R$(NR)= OB$+ "s :"+ LEFT$(SP$,NN)+ STR$(N1)+ OP$+ STR$(N2)+ " ="+ STR$(CA)
  173. 2600  T$= "":PRINT ">";
  174. 2610  I$= INKEY$:IF I$=""THEN 2610
  175. 2620  I= ASC(I$):IF (I> 31)* (I< 65) THEN 2670
  176. 2630  IF I> 96 THEN 2660
  177. 2640  IF I< 32 THEN 2610
  178. 2650  I= I+ 32:GOTO 2670
  179. 2660  I= I- 32
  180. 2670  PRINT CHR$(I);
  181. 2680  T$= T$+ CHR$(I):GOTO 2610
  182. 2690  IF I= 8 THEN 2720
  183. 2700  IF I= 13 THEN 2750
  184. 2710  GOTO 2610
  185. 2720  PRINT CHR$(I);:BS= LEN(T$)- 1:IF BS< 1 THEN 2740
  186. 2730  T$= LEFT$(T$,BS):GOTO 2610
  187. 2740  T$= "":GOTO 2610
  188. 2750  NF= 0:LT= LEN(T$):IF LT< 17 THEN 2770
  189. 2760  PRINT :PRINT "That's too long for my memory.  Please try again.":NF= 2:GOTO 2870
  190. 2770  V$(1)= "a":V$(2)= "e":V$(3)= "i":V$(4)= "o":V$(5)= "u"
  191. 2780  FOR K= 1 TO LT:FOR J= 1 TO 5:Q$= MID$ (T$,K,1):IF Q$= V$(J)THEN 2810
  192. 2790  NEXT J,K
  193. 2800  GOTO 2820
  194. 2810  NF= NF+ 1:GOTO 2790
  195. 2820  IF LT< 5 THEN 2840
  196. 2830  IF NF< INT(LT/ 4) THEN  NF= 1:GOTO 2870
  197. 2840  IF NF> 0 THEN 2860
  198. 2850  NF= 1:GOTO 2870
  199. 2860  NF= 0
  200. 2870  PRINT :RETURN 
  201. 2880  REM 2CHECKS FOR CAPITALS5
  202. 2885  IF T$="" THEN 2920
  203. 2890  T$= LEFT$(T$,1):IF  ASC(T$)< 90 THEN 2910
  204. 2900  CF= 0:GOTO 2920
  205. 2910  CF= 1
  206. 2920  RETURN 
  207. 2930  I$= INKEY$:IF I$="" THEN 2930
  208. 2940  I= ASC(I$):IF (I> 47)* (I< 58) THEN 2980
  209. 2950  IF I= 13 THEN 2970
  210. 2960  GOTO 2930
  211. 2970  MF= 1
  212. 2980  RETURN 
  213. 2990  PRINT T$:RETURN 
  214. 3000  REM  STORY GENERATION
  215. 3010  PRINT "I need the name of a person.  ";
  216. 3015  INPUT " ",T$
  217. 3030  ON NF GOTO 3040,3010
  218. 3050  P1$= T$:GOSUB 2880:IF CF= 1 THEN 3070
  219. 3060  PRINT "The names of persons begin with capital letters.":PRINT "Remember the SHIFT key. Please try again.":GOTO 3010
  220. 3070  PRINT "Is ";P1$+ " a he or a she?   ";
  221. 3075  INPUT " ",T$
  222. 3076  IF T$<>"he" AND T$<>"she" THEN 3070
  223. 3077  SX$=T$:IF SX$="he" THEN 3110
  224. 3080  IF SX$= "she" THEN 3100
  225. 3090  PRINT "I detect nonsense. I don't know any questions about ":PRINT SX$;",s anyway. Please try again.":GOTO 3070
  226. 3100  PS$= "her ":GOTO 3120
  227. 3110  PS$= "his "
  228. 3120  RETURN 
  229. 3130  N= INT(5*RND(1))
  230. 3140  ON N GOTO 3260,3160,3270,3170,3260,3180,3270,3190,3260,3200,3270,3210,3260,3220,3270,3230
  231. 3150  ON N GOTO 3260,3240,3260,3250
  232. 3160  OB$=RO$(1):GOTO 3280
  233. 3170  OB$=RO$(2):GOTO 3280
  234. 3180  OB$=RO$(3):GOTO 3280
  235. 3190  OB$=RO$(4):GOTO 3280
  236. 3200  OB$=RO$(5):GOTO 3280
  237. 3210  OB$=RO$(6):GOTO 3280
  238. 3220  OB$=RO$(7):GOTO 3280
  239. 3230  OB$=RO$(8):GOTO 3280
  240. 3240  OB$=RO$(9):GOTO 3280
  241. 3250  OB$=RO$(10):GOTO 3280
  242. 3260  GOSUB 1610:IF OB$< > "" THEN 3280
  243. 3270  N= INT(5* RND(1)):OB$= RO$(N)
  244. 3280  GOSUB 1110:PRINT "-------------------------";"(";AR+ WA+ 1;" )";
  245. 3290  PRINT "---------------------------":PRINT :ON  NO GOTO 3300,3490,3690,3980
  246. 3300  CA= N1+ N2:N= INT(1+ 5* RND(1)):ON N GOTO 3310,3350,3380,3420,3450
  247. 3310  QU$= "does "+ P1$:V$= SX$+ " takes"+ STR$ (N1)+ ", then finds"+ STR$ (N2):S1$= P1$+ " needs something "
  248. 3320  S1$= S1$+ "special at school today,"+CHR$(13)+"so "+ SX$+ " takes along"+ STR$ (N1)+ " "+ OB$:IF N1< > 1 THEN GOSUB 3530
  249. 3330  S1$= S1$+ ".":S2$= "On the way to school, "+ SX$+ " sees a hat by the"+CHR$(13)+"road; under it "+ SX$+ " finds"
  250. 3340  S2$= S2$+ STR$ (N2)+ " more.":GOTO 3660
  251. 3350  QU$= "do you":V$= "you own"+ STR$ (N1)+ ", then you're sold"+ STR$ (N2):S1$= "You look in your "+ OB$
  252. 3360  S1$= S1$+ " collection and see that you own"+ STR$ (N1)+ " "+ OB$:IF N1< > 1 THEN S1$= S1$+ "s"
  253. 3370  S1$= S1$+ ".":S2$= "Your friend, "+ P1$+ ", sells you"+ STR$ (N2)+ " more.":GOTO 3660
  254. 3380  QU$= "does "+ SX$:V$= SX$+ " made"+ STR$ (N1)+ ", then makes"+ STR$ (N2):S1$= "Last Monday, "+ P1$
  255. 3390  S1$= S1$+ " invented a machine that makes "+ OB$+ "s."+CHR$(13)+"That Monday, "+ SX$+ " made"+ STR$ (N1)+ " "+ OB$
  256. 3400  IF N1< > 1 THEN S1$= S1$+ "s"
  257. 3410  S1$= S1$+ ".":S2$= "The next day, "+ SX$+ " made"+ STR$ (N2)+ " more.":GOTO 3660
  258. 3420  QU$= "does "+ P1$:V$= SX$+ " bought"+ STR$ (N1)+ ", then buys"+ STR$ (N2):S1$= "Yesterday, "+ P1$
  259. 3430  S1$= S1$+ " bought"+ STR$ (N1)+ " "+ OB$:IF N1< > 1 THEN S1$= S1$+ "s"
  260. 3440  S1$= S1$+ ".":S2$= "Today, "+ SX$+ " goes to the store and buys"+ STR$ (N2)+ " more.":GOTO 3660
  261. 3450  QU$= "does "+ SX$:V$= P1$+ " found"+ STR$ (N1)+ ", then won"+ STR$ (N2):S1$= "This morning, "+ P1$
  262. 3460  S1$= S1$+ " looked in "+ PS$+ " pocket and found"+ STR$ (N1)+ " "+ OB$
  263. 3470  IF N1< > 1 THEN S1$= S1$+ "s"
  264. 3480  S1$= S1$+ ".":S2$= "Later, "+ SX$+ " won"+ STR$ (N2)+ " more in a bet with "+ A$+ ". (That's you.)":GOTO 3660
  265. 3490  CA= N1- N2:N= 5* RND (1)+ 1:ON N GOTO 3500,3540,3570,3600,3630
  266. 3500  S1$= "Last week, "+ P1$+ " got"+ STR$ (N1)+ " "+ OB$:IF N1< > 1 THEN GOSUB 3530
  267. 3510  S1$= S1$+ " for "+ PS$+ "birthday.":S2$= "On Saturday, "+ SX$+ " lost"+ STR$ (N2)+ " of them."
  268. 3520  QU$= "does "+ SX$:V$= P1$+ " got"+ STR$ (N1)+ ", then"+ STR$ (N2)+ " are lost":GOTO 3660
  269. 3530  S1$= S1$+ "s":RETURN 
  270. 3540  S1$="In your class at school, you made "+STR$(N1)+" "+CHR$(13)+OB$:IF N1=1 THEN 3560
  271. 3550  S1$=S1$+"s"
  272. 3560  S1$=S1$+", which you brought home.":S2$="On your way, you gave "+STR$(N2)+" of them to "+P1$+".":QU$="do you":V$="you make"+STR$(N1)+", then give away"+STR$(N2):GOTO 3660
  273. 3570  S1$=P1$+" was carrying "+STR$(N1)+" "+OB$:IF N1=1 THEN 3590
  274. 3580  S1$=S1$+"s"
  275. 3590  S1$=S1$+" in a box.":S2$="Coming down the hill, "+SX$+" fell, and"+STR$(N2)+" of them"+CHR$(13)+"rolled away.":QU$="does "+SX$:V$=SX$+" had"+STR$(N2)+" roll away.":GOTO 3660
  276. 3600  S1$=P1$+" found "+STR$(N1)+" "+OB$:IF N1=1 THEN 3620
  277. 3610  S1$=S1$+"s"
  278. 3620  S1$=S1$+" under "+PS$+" bed.":S2$="Bill, "+PS$+" big brother, took "+STR$(N2)+" of them away.":QU$="does "+P1$:V$=P1$+" found"+STR$(N1)+" but Bill took"+STR$(N2):GOTO 3660
  279. 3630  S1$=P1$+" gave you "+STR$(N1)+" "+OB$:IF N1=1 THEN 3650
  280. 3640  S1$=S1$+"s"
  281. 3650  S1$=S1$+" because "+SX$+" had too many.":S2$="Later, "+SX$+" lost all of them, and you generously"+CHR$(13)+"gave "+STR$(N2)+" back.":QU$="do you":V$=P1$+" gave you"+STR$(N1)+", you gave back"+STR$(N2)
  282. 3660  QU$= "How many "+ OB$+ "s "+ QU$+ " have now"
  283. 3670  PRINT S1$:PRINT :PRINT S2$
  284. 3680  PRINT :PRINT "    ";QU$;:INPUT "";NQ:PRINT "";:RETURN
  285. 3690  CA= N1* N2:N= 5* RND (1)+ 1:ON  N GOTO 3700,3750,3800,3860,3920
  286. 3700  S1$= "You get a surprise! "+ P1$+ " sends you"+ STR$ (N1)+ " box":V$= STR$ (N1)+ " box"
  287. 3710  IF N1< > 1 THEN S1$= S1$+ "es":S2$= S2$+ "es"
  288. 3720  S1$= S1$+ " in the mail.":V$= V$+ " ..."+ STR$ (N2)+ " in each box":S2$= "Each box has"+ STR$ (N2)+ "  "+ OB$
  289. 3730  IF N2< > 1 THEN S2$= S2$+ "s"
  290. 3740  S2$= S2$+ " in it!":QU$= "do you":GOTO 3660
  291. 3750  S1$=P1$+" won"+STR$(N1)+" ticket":V$=STR$(N1)+"ticket":IF N1=1 THEN 3770
  292. 3760  S1$=S1$+"s":V$=V$+"s"
  293. 3770  S1$=S1$+".":S2$="When "+SX$+" traded them in, "+SX$+" got"+STR$(N2)+" "+OB$:IF N2=1 THEN 3790
  294. 3780  S2$=S2$+"s"
  295. 3790  S2$=S2$+" for each ticket.":V$=V$+" ..."+STR$(N2)+" for each ticket":QU$="does "+SX$:GOTO 3660
  296. 3800  S1$="A flying saucer deposits"+STR$(N1)+" metal sphere":V$=STR$(N1)+" sphere":IF N1=1 THEN 3820
  297. 3810  S1$=S1$+"s":V1$=V1$+"s"
  298. 3820  S1$=S1$+" in your kitchen"+CHR$(13)+"sink.":S2$="When "+P1$+" opens them,"+STR$(N2)+" "+OB$:IF N2=1 THEN 3840
  299. 3830  S2$=S2$+"s pop":GOTO 3850
  300. 3840  S2$=S2$+" pops"
  301. 3850  S2$=S2$+" out of every one.":V$=V$+" ..."+STR$(N2)+" in every one.":QU$="do you":GOTO 3660
  302. 3860  S1$="Your friend, "+P1$+", dug up"+STR$(N1)+" can":V$=STR$(N1)+" can":IF N1=1 THEN 3880
  303. 3870  S1$=S1$+"s":V1$=V1$+"s"
  304. 3880  S1$=S1$+" full of "+OB$+"s.":S2$="There ":IF N2=1 THEN 3900
  305. 3890  S2$=S2$+"were "+STR$(N2)+" "+OB$+"s":GOTO 3910
  306. 3900  S2$=S2$+"was 1   "+OB$
  307. 3910  S2$=S2$+" in each can.":V$=V$+" ..."+STR$(N2)+" in each can":QU$="does "+SX$:GOTO 3660
  308. 3920  S1$=P1$+" found"+STR$(N1)+" hole":V$=STR$(N1)+" hole":IF N1=1 THEN 3940
  309. 3930  S1$=S1$+"s":V$=V$+"s"
  310. 3940  S1$=S1$+" dug in "+PS$+" yard.":S2$="In each hole there ":IF N2=1 THEN 3960
  311. 3950  S2$=S2$+"were "+STR$(N2)+" "+OB$+"s.":GOTO 3970
  312. 3960  S2$=S2$+"was 1 "+OB$+"."
  313. 3970  V$=V$+" ..."+STR$(N2)+" in each hole":QU$="does "+P1$:GOTO 3660
  314. 3980  QU$= "does each one":CA= N1/ N2:N= 5* RND (1)+ 1:ON N GOTO 3990,4060,4090,4140,4170
  315. 3990  N1= N1+ CA:CA= N1/ (N2+ 1):S1$= P1$+ " found a bag with"+ STR$ (N1)+ "  "+ OB$
  316. 4000  IF N1< > 1 THEN S1$= S1$+ "s"
  317. 4010  S1$= S1$+ " in it.":S2$= "After school, "+ SX$+ " shared them with "+ PS$+ STR$ (N2)+ " sister"
  318. 4020  IF N2< > 1 THEN S2$= S2$+ "s"
  319. 4030  V$= "each person gets":S2$= S2$+ ".":N2= N2+ 1:GOTO 3660
  320. 4040  S2$=S2$+ "nobody, but ate them all. Greedy child!"
  321. 4050  QU=" does each one":GOTO 3660
  322. 4060  N1=N1+CA:CA=N1/(N2+1)
  323. 4070  S1$=P1$+"'s rich uncle gives you a rosewood box with"+STR$(N1)+CHR$(13)+OB$+"s in it.":S2$="You share them with"+STR$(N2)+" friends who come "+CHR$(13)+"to a tea party."
  324. 4080  V$="each friend gets":QU$="does each or you":N2=N2+1:GOTO 3660
  325. 4090  OB$="seeds":S1$="A seed packet has "+STR$(N1)+" seed":IF N1=1 THEN 4110
  326. 4100  S1$=S1$+"s"
  327. 4110  S1$=S1$+" in it":S2$=P1$+" plants"+STR$(N2)+" seed":IF N2=1 THEN 4130
  328. 4120  S2$=S2$+"s"
  329. 4130  S2$=S2$+" in each hole.":V$="holes "+P1$+" needs":QU$="holes does "+P1$+" need":GOTO 4220
  330. 4140  S1$=P1$+" worked for"+STR$(N1)+ " day":IF N1=1 THEN 4160
  331. 4150  S1$=S1$+"s"
  332. 4160  S1$=S1$+" building "+OB$+"s.":S2$="When "+SX$+" finished, "+SX$+" had made only"+STR$(N2)+"."+".":V$="days to make each":QU$=" days does it take "+P1$+" to make 1 "+OB$:GOTO 4220
  333. 4170  S1$="You and "+P1$+" catch"+STR$(N1)+" "+OB$:IF N1=1 THEN 4190
  334. 4180  S1$=S1$+"s"
  335. 4190  S1$=S1$+" in "+OB$+" traps in the forest.":S2$="You dug"+STR$(N2)+" trap":IF N2=1 THEN 4210
  336. 4200  S2$=S2$+"s"
  337. 4210  S2$=S2$+".":V$="each trap caught (as an average)":QU$="(on the average) did each trap catch"
  338. 4220  QU$=" How many "+QU$:GOTO 3670
  339. 4230  LOCATE PY,PX:PY= PY+ 1:RETURN
  340. 5000  CLS:PRINT "THERE APPEARS TO BE SOMETHING THAT I":PRINT "CANNOT UNDERSTAND!"
  341. 5010  PRINT:PRINT "LET'S START THIS AGAIN--JUST IN CASE":PRINT "I'VE FORGOTTEN ANYTHING."
  342. 5020  PRINT:PRINT "PRESS THE <SPACE BAR> TO GO ON."
  343. 5030  Y$=INKEY$:IF Y$<>" " THEN 5030
  344. 5035  CLS
  345. 5040  RESUME 1440
  346.