home *** CD-ROM | disk | FTP | other *** search
/ Play and Learn 2 / 19941.ZIP / 19941 / EDUCMATH / ALGEBRA / INSTR.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1994-02-04  |  13.4 KB  |  243 lines

  1. 0  OUT &H3D8,14:COLOR 0:DEF SEG=&H40:POKE &H65,14:DEF SEG
  2. 1  OBJ.ONE$="ne3nf3": DIM X.MARK#(4),P.POINT#(4)
  3. 2  OBJ.TWO$="bh1h2bf3;be1e2bg3;bf1f2bh3;bg1g2be3"
  4. 3  OBJ.THR$="nu3nd3nr3nl3;d2r1u4d1r1d2l4u2r1u1d4"
  5. 4  OBJ.FOU$="nu2nd2nr2l2;r1u1r2d2l2u2"
  6. 5  FIVE$="nr3;d2;r2br1;bd1d2bd1;bl1l2u1"
  7. 6  NEG$="r2bu3br2"
  8. 7  ONE$="bd1r1u1d6l1r2bu6br3"
  9. 8  ZERO$="br1r1br1bd1d4bd1bl1l1bl1bu1u4"
  10. 9  TEN$=ONE$+ZERO$
  11. 10  COMMON N$,CHN.LOC!
  12. 11  'N$="Kevin":KEY 1,"SCREEN 0,0,0,0":KEY 3,"COLOR 7,1,1":KEY 5,"SCREEN 1":KEY 2,"LIST ":KEY 4,"SAVE"+CHR$(34)+"INSTR":KEY 6,"LLIST ":KEY 8,"EDIT "
  13. 12  DEF SEG=0:POKE 1050,PEEK(1052):DEF SEG:GOTO 240
  14. 20  REM Wait for user to hit RETURN.
  15. 30  DEF SEG=0:POKE 1050,PEEK(1052):DEF SEG:LOCATE 25,9,0:PRINT "Press ";:POKE &H4E,1:PRINT "ENTER";:POKE &H4E,3:PRINT " to continue.";
  16. 40  ZZ=ASC(INPUT$(1)):IF ZZ<>13 THEN 40
  17. 50  DEF SEG=0:POKE 1050,PEEK(1052):DEF SEG:RETURN
  18. 210  LOCATE 15,1:PRINT STRING$(40,"_"):PRINT "1) Add same value to both sides":PRINT "2) Subtract same value from both sides"
  19. 220  PRINT "3) Multiply both sides by same value": PRINT "4) Divide both sides by same value";:RETURN
  20. 230  G$=INPUT$(1):ON G$<>CHR$(13) GOTO 230:RETURN
  21. 240  REM Instructions
  22. 250  CLS:PRINT "Hi, "N$"."
  23. 270  LOCATE 5,1:PRINT "I know two types of problems.  The":PRINT :PRINT "easier equations are in the form y=mx+b.":PRINT "The harder equations are in other forms."
  24. 280  LOCATE 13,1:PRINT "You may choose either type, or you may":PRINT :PRINT "select a mixture of the two types."
  25. 290  GOSUB 20
  26. 300  CLS:PRINT "When you begin working on a problem, I":PRINT :PRINT "will print the equation at the top of":PRINT :PRINT "the screen."
  27. 310  LOCATE 9,1:PRINT "If the equation is not in the form":PRINT :PRINT "y=mx+b, you will have to solve for y."
  28. 320  LOCATE 15,1:PRINT "In a few problems, y may not appear in":PRINT :PRINT "the equation.  In these special cases,":PRINT :PRINT "you will solve for x instead of y."
  29. 330  GOSUB 20
  30. 340  CLS:PRINT "When the equation is in the proper form,":PRINT "you must find three pairs of coordinates":PRINT"in order to plot them on a line.  For":PRINT:PRINT"each pair, you will choose the value":PRINT
  31. 345  PRINT"of x.  I will help you find the":PRINT:PRINT"corresponding value of y.":PRINT:PRINT
  32. 350  PRINT "Be sure that x and y are integer":PRINT :PRINT "values between -10 and 10 so that":PRINT :PRINT "the coordinate can be plotted on our":PRINT :PRINT "graph."
  33. 360  GOSUB 20
  34. 370  CLS:PRINT "When you have chosen three points, your":PRINT :PRINT "last step is to plot them."
  35. 380  LOCATE 7,1:PRINT "I will show you a graph.  At the center":PRINT:PRINT"of the graph, you will see a flashing X,":PRINT"called the cursor."
  36. 390  LOCATE 15,1:PRINT "To plot a point, just move the cursor":PRINT :PRINT "to the correct location, and press":PRINT :POKE &H4E,1:PRINT "ENTER";:POKE &H4E,3:PRINT "."
  37. 400  GOSUB 20
  38. 410  CLS:PRINT "To move the cursor, use the ";:POKE 78,1:PRINT "I";:POKE 78,3:PRINT ", ";:POKE 78,1:PRINT "J";:POKE 78,3:PRINT ", ";:POKE 78,1:PRINT "K";:POKE 78,3:PRINT ",":PRINT:PRINT "and ";:POKE 78,1:PRINT "M";:POKE 78,3
  39. 420  PRINT " keys.  If you find these keys and":PRINT :PRINT "notice their positions, it will make"
  40. 430  PRINT:PRINT "sense that:":PRINT
  41. 440  POKE 78,1:PRINT SPC(5);"I";:POKE 78,3:PRINT " moves the cursor up.":PRINT:POKE 78,1:PRINT SPC(5);"J";:POKE 78,3:PRINT " moves the cursor left.":PRINT :POKE 78,1:PRINT SPC(5);"K";:POKE 78,3:PRINT " moves the cursor right.":PRINT :POKE 78,1
  42. 450  PRINT SPC(5);"M";:POKE 78,3:PRINT " moves the cursor down."
  43. 460  LOCATE 19,1:PRINT "In case you forget, there is a chart":PRINT:PRINT "next to the graph."
  44. 465  GOSUB 20
  45. 470  CLS:LOCATE 3,1:PRINT "If you make a mistake plotting a point,":PRINT :PRINT "I will help you.  You will be able to":PRINT :PRINT "choose between sound clues and silent":PRINT :PRINT "clues."
  46. 475  LOCATE 15,1:PRINT "When you have plotted all three points,":PRINT :PRINT "I will finish the problem by drawing the":PRINT "line through them.  That line is the":PRINT :PRINT "graph of the equation."
  47. 480  GOSUB 20
  48. 485  CLS:LOCATE 5,1:PRINT "After each problem, I will give":PRINT :PRINT "you a summary of your errors."
  49. 500  LOCATE 10,1:PRINT "When you finish a set of problems, I":PRINT :PRINT "will give you a total error analysis."
  50. 510  GOSUB 20: GOTO 580
  51. 520  CLS:LOCATE 10,1:PRINT "   Would you like to review the":PRINT :PRINT "   instructions (Y or N)?  ";:G$=""
  52. 530  GOSUB 10000:IF G$="Y" OR G$="y" THEN PRINT CHR$(29)"Y";:GOTO 240
  53. 540  IF G$<>"n" AND G$<>"N" THEN 530
  54. 550  PRINT CHR$(29)"N";
  55. 560  CLS:LOCATE 12,(30 - LEN(N$)) / 2: PRINT "Good luck, ";N$;"."
  56. 570  CHAIN"cbs",CHN.LOC!
  57. 580  CLS:LOCATE 10,7:PRINT "Would you like to do a":PRINT :LOCATE ,7:PRINT "sample problem (Y or N)?  ";:G$=""
  58. 582  GOSUB 10000:IF G$="N" OR G$="n" THEN PRINT CHR$(29)"N":GOTO 520
  59. 584  IF G$<>"Y" AND G$<>"y" THEN 582 ELSE PRINT CHR$(29)"Y"
  60. 590  CLS:PRINT "Graph:";:LOCATE ,14:PRINT "8x-2y = 2":LINE (0,9)-(48,9),3:LINE(0,12)-(320,12),1
  61. 600  LOCATE 10,4:PRINT "The first step in graphing this":PRINT :PRINT "equation is to solve it for y.":GOSUB 20
  62. 610  LOCATE 3,1:GOSUB 3970:LOCATE 4,14:PRINT "8x-2y = 2":GOSUB 210:LOCATE 24,1:PRINT "Let's use subtraction.  Press <2>:  ";
  63. 620  GOSUB 10000:IF G$<>"2" THEN 620:ELSE PRINT CHR$(29)G$;:LOCATE 6,1:GOSUB 3970
  64. 630  PRINT :PRINT "   To isolate the y term, we will":PRINT :PRINT "subtract 8x from both sides.":LOCATE 15,1:PRINT STRING$(40,"_"):PRINT "Subtract from both sides: ":LOCATE 24,13:PRINT "Type <8x>:  ";
  65. 640  GOSUB 10000:IF G$<>"8" THEN 640:ELSE PRINT CHR$(29)G$" ";:G$=""
  66. 650  GOSUB 10000:IF G$<>"X" AND G$<>"x" THEN 650:ELSE PRINT CHR$(29)"x ";
  67. 660  LOCATE 6,11:GOSUB 3970:PRINT "8x-8x-2y = -8x+2":PRINT:LOCATE ,9:PRINT "Now we must simplify the equation by":PRINT :PRINT "combining any like terms."
  68. 670  LOCATE 15,1:PRINT STRING$(40,"_"):PRINT "8x - 8x = ";:LOCATE 24,13:PRINT "Press <0>:  ";:G$=""
  69. 680  GOSUB 10000:IF G$<>"0" THEN 680 ELSE PRINT CHR$(29)G$;
  70. 690  LOCATE 8,16:GOSUB 3970:PRINT "-2y = -8x+2":PRINT :PRINT "Now we must set the coefficient of y":PRINT :PRINT "equal to one.":GOSUB 210:LOCATE 24,1:PRINT "Let's use division.  Press <4>:  ";
  71. 700  GOSUB 10000:IF G$<>"4" THEN 700 ELSE PRINT CHR$(29)G$;
  72. 710  LOCATE 10,1:GOSUB 3970:PRINT:PRINT "We must divide by -2.":LOCATE 15,1:PRINT STRING$(40,"_");:PRINT:PRINT "Divide both sides by:":LOCATE 24,13:PRINT "Type <-2>:  ";
  73. 720  GOSUB 10000: IF G$<>"-" THEN 720 ELSE PRINT CHR$(29)G$" ";
  74. 730  GOSUB 10000: IF G$<>"2" THEN 730 ELSE PRINT CHR$(29)G$;
  75. 740  LOCATE 10,9:GOSUB 3970:PRINT "(-2y)/(-2) = (-8x+2)/(-2)":PRINT :LOCATE 12,1:GOSUB 3970:PRINT:PRINT "Now we must perform the division, term":PRINT :PRINT "by term.":GOSUB 20
  76. 750  LOCATE 12,1:GOSUB 3970:LOCATE 15,1:PRINT STRING$(40,"_"):PRINT "(-2y)/(-2) = ":LOCATE 24,13:PRINT "Press <y>:  ";
  77. 760  GOSUB 10000: IF G$<>"y" AND G$<>"Y" THEN 760 ELSE PRINT CHR$(29)"y";
  78. 770  LOCATE 10,9:PRINT "         y";:LOCATE 17,1:PRINT "(-8x)/(-2) = ";:LOCATE 24,1:LOCATE 24,1:PRINT SPACE$(35);:LOCATE ,13:PRINT "Type <4x>:  ";
  79. 780  GOSUB 10000: IF G$<>"4" THEN 780 ELSE PRINT CHR$(29)G$" ";
  80. 790  GOSUB 10000: IF G$<>"x" AND G$<>"X" THEN 790 ELSE PRINT CHR$(29)"x";
  81. 800  LOCATE 10,22:PRINT "4x+(2)/(-2) ":LOCATE 24,1:PRINT SPACE$(35);:LOCATE ,13:PRINT "Type <-1>:  ";: LOCATE 17,1:PRINT SPACE$(20);:LOCATE ,1:PRINT "(2)/(-2) = ";:LOCATE 24,25
  82. 810  GOSUB 10000: IF G$<>"-" THEN 810 ELSE PRINT CHR$(29)G$" ";
  83. 820  GOSUB 10000: IF G$<>"1" THEN 820 ELSE PRINT CHR$(29)G$;
  84. 830  LOCATE 10,22:PRINT "4x-1       ":LOCATE 13,1:GOSUB 3970:PRINT "Nice going, "N$".":PRINT :PRINT "We have solved the original equation":PRINT :PRINT "for y.  We're done with the first step.":GOSUB 20
  85. 840  LOCATE 4,1:GOSUB 3970:LOCATE 6,5:PRINT "x";:LOCATE ,14:PRINT "y = 4x-1";:LOCATE ,35:PRINT "y"
  86. 850  LINE(14,49)-(298,49),2:LINE(14,51)-(298,51),2:LINE(56,40)-(56,103),2:LINE(58,40)-(58,103),2:LINE(253,40)-(253,103),2:LINE(255,40)-(255,103),2
  87. 860  LINE(0,113)-(319,116),1,BF
  88. 865  LOCATE 16,1:PRINT "   Now we must find three points on the":PRINT :PRINT "line represented by this equation.  All":PRINT :PRINT "points must be integers between"
  89. 870  PRINT :PRINT "-10 and 10.":GOSUB 20:LOCATE 16,1:GOSUB 3970:PRINT:PRINT "   To help you out, I will tell you":PRINT :PRINT "what points to choose.":GOSUB 20
  90. 880  LOCATE 16,1:GOSUB 3970:PRINT:PRINT "Enter the x coordinate: ":LOCATE 24,13:PRINT "Press <0>:  ";
  91. 890  GOSUB 10000:IF G$<>"0" THEN 890 ELSE PRINT CHR$(29)G$;
  92. 900  LOCATE 8,5:PRINT "0";:LOCATE ,14:PRINT "y = (4)(0)-1";:LOCATE 16,1:GOSUB 3970:PRINT:PRINT "4 * 0 = ":LOCATE 24,13:PRINT "Press <0>:  ";
  93. 910  GOSUB 10000:IF G$<>"0" THEN 910 ELSE PRINT CHR$(29)G$;:LOCATE 19,1:PRINT "0 - 1 = ":LOCATE 24,1:PRINT SPACE$(35);:LOCATE ,13:PRINT "Type <-1>:  ";
  94. 920  GOSUB 10000: IF G$<>"-" THEN 920 ELSE PRINT CHR$(29)G$" ";
  95. 930  GOSUB 10000:IF G$<>"1" THEN 930 ELSE PRINT CHR$(29)G$;:LOCATE 8,34:PRINT "-1";
  96. 940  LOCATE 16,1:GOSUB 3970:PRINT:PRINT "Enter the x coordinate: ":LOCATE 24,13:PRINT "Press <1>:  ";
  97. 950  GOSUB 10000: IF G$<>"1" THEN 950 ELSE PRINT CHR$(29)G$;:LOCATE 10,5:PRINT "1";:LOCATE ,14:PRINT "y = (4)(1)-1";:LOCATE 16,1:GOSUB 3970:PRINT:PRINT "4 * 1 = ":LOCATE 24,13:PRINT "Press <4>:  ";
  98. 960  GOSUB 10000:IF G$<>"4" THEN 960 ELSE PRINT CHR$(29)G$;:LOCATE 19,1:PRINT "4 - 1 = ":LOCATE 24,1:PRINT SPACE$(35);:LOCATE ,13:PRINT "Press <3>:  ";
  99. 970  GOSUB 10000: IF G$<>"3" THEN 970 ELSE PRINT CHR$(29)G$;
  100. 980  LOCATE 10,35:PRINT "3";:LOCATE 16,1:GOSUB 3970:PRINT:PRINT "Enter the x coordinate: ":LOCATE 24,13:PRINT "Press <2>:  ";
  101. 990  GOSUB 10000: IF G$<>"2" THEN 990 ELSE PRINT CHR$(29)G$;:LOCATE 12,5:PRINT "2";:LOCATE ,14:PRINT "y = (4)(2)-1";:LOCATE 16,1:GOSUB 3970:PRINT:PRINT "4 * 2 = ":LOCATE 24,13:PRINT "Press <8>:  ";
  102. 1000  GOSUB 10000: IF G$<>"8" THEN 1000 ELSE PRINT CHR$(29)G$;:LOCATE 19,1:PRINT "8 - 1 = ":LOCATE 24,1:PRINT SPACE$(35);:LOCATE ,13:PRINT "Press <7>:  ";
  103. 1010  GOSUB 10000:IF G$<>"7" THEN 1010 ELSE PRINT CHR$(29)G$;
  104. 1020  LOCATE 12,35:PRINT "7";:LOCATE 14,1:PRINT SPACE$(39):LOCATE 16,1:GOSUB 3970:PRINT:PRINT "That's it, "N$"!":PRINT :PRINT "Now that we've found three points,":PRINT :PRINT "it's time to plot them.":GOSUB 20
  105. 1030  CLS
  106. 2000  A%=1:B%=4:C%=-1:Z1%=1:MG%=1:SS%=154:TC%=11:P%(1,1)=0:P%(1,2)=-1:P%(2,1)=1:P%(2,2)=3:P%(3,1)=2:P%(3,2)=7:CLS
  107. 2010  DEF FN WH(X)=ABS(X - INT(X))< 9.9999E-05
  108. 2020  DEF FN R(X) = INT( X * RND(1)+1)
  109. 2030  DEF FN SIGN(X)= -3 + 2 * FN R(2)
  110. 2040  PI=3.14159
  111. 2050  EXIT.TOG = 0
  112. 2060  ACCEPT.KEYS$="IJKMHKMP8462"
  113. 2070  TC%=11:SS%=154
  114. 2080  DEF FN HC(X)= INT (X*SS% / (2 * TC%) + SS% / 2 + 0.5)
  115. 2090  DEF FN VC(Y)= INT(-Y * SS% / (2 * TC%) + SS% / 2 + 0.5)
  116. 2120  MG%=-1:GOSUB 2850
  117. 2130  LINE(201,10)-(292,10),1:LINE(201,12)-(292,12),1:LINE(245,0)-(245,40),1:LINE(247,0)-(247,40),1:LOCATE 1,28:PRINT "x";:LOCATE ,35:PRINT "y"
  118. 2140  FOR ZZ=1 TO 3:LOCATE ZZ+2,29-LEN(STR$(P%(ZZ,1))):PRINT P%(ZZ,1);:LOCATE ,36-LEN(STR$(P%(ZZ,2))):PRINT P%(ZZ,2):NEXT ZZ
  119. 2150  LOCATE 8,32:PRINT CHR$(24):LOCATE ,32:PRINT "I":LOCATE ,30:PRINT CHR$(27)"J K"CHR$(26):LOCATE ,32:PRINT "M":LOCATE ,32:PRINT CHR$(25)
  120. 2160  'LOCATE 13,23:PRINT "Press ";:DEF SEG:POKE &H4E,1:PRINT "ENTER";:POKE &H4E,3:PRINT " when":LOCATE ,23:PRINT "the cursor is on":LOCATE ,23:PRINT "the right point."
  121. 2680  GOSUB 3580
  122. 2690  GOTO 520
  123. 2850  REM Set up axes and grid
  124. 2860  PRESET(5,4):DRAW"c2"+OBJ.TWO$
  125. 2865  PRESET(4,4):DRAW"c2"+OBJ.TWO$
  126. 2870  PRESET(3,4):DRAW"c2"+OBJ.TWO$:GET(0,0)-(8,8),X.MARK#
  127. 2875  PUT(0,0),X.MARK#:CIRCLE(4,4),4,3:PAINT(4,4),3,3:GET(0,0)-(8,8),P.POINT#
  128. 2880  LINE(0,0)-(160,200),0,BF:LINE(0,50)-(320,200),0,BF
  129. 2885  IF NOT MG% THEN 2900
  130. 2890  LINE (FN HC(-TC%)+2, FN VC(0)+1)-( FN HC(TC%) - 2, FN VC(0)+1),3
  131. 2895  LINE (FN HC(0)-1, FN VC(-TC%)-2)-( FN HC(0) - 1, FN VC(TC%)+2),3
  132. 2900  LINE (FN HC(-TC%),FN VC(0))-(FN HC(TC%),FN VC(0)),3:LINE (FN HC(0),FN VC(-TC%))-(FN HC(0),FN VC(TC%)),3
  133. 2905  PRESET(FN HC(-TC%),FN VC(0)):DRAW "c3a0"+OBJ.ONE$:PRESET(FN HC(0), FN VC(TC%)):DRAW"c3a3"+OBJ.ONE$:PRESET(FN HC(TC%),FN VC(0)):DRAW"c3a2"+OBJ.ONE$:PRESET(FN HC(0),FN VC(-TC%)):DRAW"c3a1"+OBJ.ONE$
  134. 2910  IF NOT MG% THEN FOR ZZ=1-TC% TO TC%-1:LINE(FN HC(ZZ),FN VC(0)-4)-(FN HC(ZZ),FN VC(0)+4),1:LINE (FN HC(0)-4,FN VC(ZZ))-(FN HC(0)+4,FN VC(ZZ)),1:NEXT ZZ:GOTO 2920
  135. 2915  FOR ZZ=1 TO TC%: LINE (FN HC(-ZZ),FN VC(TC%))-(FN HC(ZZ),FN VC(-TC%)),1,B:LINE(FN HC(-TC%),FN VC(ZZ))-(FN HC(TC%),FN VC(-ZZ)),1,B:NEXT ZZ
  136. 2920  LOCATE 2,9:PRINT "y":LOCATE 9,19:PRINT "x"
  137. 2925  DRAW"c3a0;bm1,83"+NEG$+"bl1"+TEN$:DRAW"c3a0;bm39,83"+NEG$+"br1"+FIVE$
  138. 2930  DRAW"c3a0;bm81,4"+TEN$:DRAW"c3a0;bm86,39"+FIVE$
  139. 2935  DRAW"c3a0;bm114,80"+FIVE$:DRAW"c3a0;bm144,80"+TEN$
  140. 2940  DRAW"c3a0;bm81,111"+NEG$+"br1"+FIVE$:DRAW"c3a0;bm78,146"+NEG$+"bl1"+TEN$
  141. 2945  IF MG% THEN LINE(FN HC(0),14)-(FN HC(TC%),14),1:LINE (FN HC(0),0)-(FN HC(TC%),0),1:LINE (FN HC(1),FN VC(TC%))-(FN HC(1),FN VC(-TC%)),1
  142. 2950  IF MG% THEN LINE(FN HC(-TC%),FN VC(TC%))-(FN HC(-TC%),FN VC(-TC%)),1:LINE (FN HC(1),FN VC(-4))-(FN HC(4),FN VC(-4)),1:LINE (FN HC(1),FN VC(-6))-( FN HC(4),FN VC(-6)),1
  143. 2955  RETURN
  144. 3000  REM Move cursor
  145. 3010  X%=0:Y%=0:PL%=0
  146. 3030  PUT(FN HC(X%)-4,FN VC(Y%)-4),X.MARK#:PL%=NOT PL%
  147. 3050  IF H1% THEN LOCATE 19,31:DX%=X%:DY%=Y%:GOSUB 3500:IF X%<>-10 OR Y%<>-10 THEN PRINT SPC(40-POS(0));
  148. 3060  ON Z1% GOTO 6000,6100,6200
  149. 3070  IF PL% THEN PUT(FN HC(X%)-4,FN VC(Y%)-4),X.MARK#:PL%=0
  150. 3080  IF ZZ%=13 THEN 3140
  151. 3090  ON ZZ%-72 GOTO 3100,3110,3120,3030,3130
  152. 3100  Y%=Y%+ABS(Y%<>TC%-1):GOTO 3030
  153. 3110  X%=X%-ABS(X%<>1-TC%):GOTO 3030
  154. 3120  X%=X%+ABS(X%<>TC%-1):GOTO 3030
  155. 3130  Y%=Y%-ABS(Y%<>1-TC%):GOTO 3030
  156. 3140  IF NOT PL% THEN PUT(FN HC(X%)-4,FN VC(Y%)-4),X.MARK#:PL%=-1
  157. 3150  RETURN
  158. 3160  REM Plot a point.
  159. 3170  REM Pass coordinates of
  160. 3180  REM point to be plotted
  161. 3190  REM in CX%,CY%.
  162. 3200  GOSUB 3480:LOCATE 17,24:POKE &H4E,2:PRINT "Plot:  ";:POKE &H4E,3:DX%=CX%:DY%=CY%:GOSUB 3500
  163. 3210  H1%=0
  164. 3220  H2%=0
  165. 3230  GOSUB 3000
  166. 3430  PUT (FN HC(X%)-4, FN VC(Y%)-4), X.MARK#:GOSUB 3480: ON FN R(3) GOTO 3440,3450:PRINT "   Good work, ";N$;".":PRINT "You found the right point.":GOTO 3460
  167. 3440  PRINT "   Brilliant job, ";N$;".":PRINT "That's the point you were looking for.":GOTO 3460
  168. 3450   PRINT "   Excellent, ";N$;".":PRINT "There's the point you wanted."
  169. 3460  PRESET(FN HC(CX%), FN VC(CY%)):DRAW"c2"+OBJ.THR$
  170. 3470  LOCATE 17,24:PRINT SPACE$(16);:LOCATE 19,24:PRINT SPACE$(16);:RETURN
  171. 3480  REM Clear bottom of screen
  172. 3490  LOCATE 21,1:GOSUB 3970:RETURN
  173. 3500  REM Write an ordered pair.
  174. 3510  REM Pass coordinates in
  175. 3520  REM DX% and DY%.
  176. 3525  PRINT "(";RIGHT$(STR$(DX%),LEN(STR$(DX%))+(SGN(DX%)<>-1));",";
  177. 3528  PRINT RIGHT$(STR$(DY%),LEN(STR$(DY%))+(SGN(DY%)<>-1));")";
  178. 3530  RETURN
  179. 3540  REM Wait for user to hit RETURN
  180. 3550  LOCATE 25,9:PRINT "Press ";:POKE &H4E,1:PRINT "ENTER";:POKE &H4E,3:PRINT " to continue.";
  181. 3560  DEF SEG=0:POKE 1052,PEEK(1050):DEF SEG
  182. 3570  ZZ$="":WHILE ZZ$<>CHR$(13):ZZ$=INKEY$:WEND
  183. 3575  LOCATE 25,7:PRINT SPC(30);:RETURN
  184. 3580  REM Draw a line.
  185. 3590  REM Pass coordinates of
  186. 3600  REM three points in
  187. 3610  REM P%(1-3,1-2).
  188. 3620  FOR P=1 TO 3:CX%=P%(P,1):CY%=P%(P,2):GOSUB 3160:GOSUB 3540:GOSUB 3480:NEXT P
  189. 3630  PRINT "  Good job, ";N$;".  You found all":PRINT "three points.  Now it's time to draw theline.":GOSUB 3540:GOSUB 3480
  190. 3650  MG%=0:GOSUB 2850:FOR ZZ=1 TO 3:PRESET(FN HC(P%(ZZ,1)),FN VC(P%(ZZ,2))):DRAW "c2"+OBJ.FOU$:NEXT ZZ
  191. 3660  GOSUB 3480:PRINT "  Okay, ";N$;".  Now I'm ready to":PRINT "finish the graph by drawing a line":PRINT "through the three points you plotted.":GOSUB 3540:GOSUB 3480
  192. 3685  P=3:X(1)=2.9:Y(1)=10:X(2)=-2.6:Y(2)=-10
  193. 3720  X(P)=TC%:Y(P)=(C%-A%*X(P))/B%
  194. 3730  LINE(FN HC(X(1)),FN VC(Y(1))) - (FN HC(X(2)), FN VC(Y(2))),2
  195. 3810  FOR ZZ=1 TO 4:NEXT ZZ
  196. 3920  GOSUB 3480:PRINT "   Great, ";N$;".  You have graphed:":PRINT:PRINT TAB(15)"8x-2y = 2.";:GOSUB 3540
  197. 3930  RETURN
  198. 3940  REM Clear bottom of screen.
  199. 3950  REM (during Choosing Points Portion)
  200. 3960  LOCATE 16,1:GOSUB 3970:LOCATE 16,1:RETURN
  201. 3970  REM  A routine to duplicate
  202. 3980  REM  the Apple CHR$(6) clear
  203. 3990  REM  to end of screen command.
  204. 4000  LINE(0,(CSRLIN-1)*8)-(320,200),0,BF
  205. 4010  RETURN
  206. 6000  IF Y%=0 THEN LOCATE 24,8:PRINT "To move down, press <M>.";
  207. 6010  ZZ$=INKEY$:GOSUB 7000: IF ZZ%<>13 AND ZZ%<>77 THEN 3030
  208. 6020  IF Y%=0 AND ZZ%=77 THEN LOCATE 24,8:PRINT "   Now press <ENTER>.   ";:GOTO 3070
  209. 6030  IF Y%=-1 AND ZZ%=13 THEN Z1%=Z1%+1:GOTO 3080
  210. 6040  GOTO 3030
  211. 6100  IF X%=0 THEN LOCATE 24,8:PRINT "To move right, press <K>.";
  212. 6105  IF Y%=3 THEN LOCATE 24,9:PRINT "  Now press <ENTER>.  ";
  213. 6110  ZZ$=INKEY$:GOSUB 7000:IF ZZ%<>13 AND ZZ%<>75 AND ZZ%<>73 THEN 3030
  214. 6120  IF X%=0 AND ZZ%=75 THEN LOCATE 24,8:PRINT " To move up, press <I>.  ";:GOTO 3070
  215. 6130  ON ABS(X%=1 AND Y%<>3 AND ZZ%=73) GOTO 3070
  216. 6140  IF Y%=3 AND ZZ%=13 THEN Z1%=Z1%+1:GOTO  3070
  217. 6160  GOTO 3030
  218. 6200  IF X%<>2 THEN LOCATE 24,8:PRINT "To move right, press <K>.";
  219. 6205  IF X%=2 AND Y%<>7 THEN LOCATE 24,8:PRINT "To move up, press <I>.     ";
  220. 6206  IF X%=2 AND Y%=7 THEN LOCATE 24,8:PRINT "    Now press <ENTER>.    ";
  221. 6210  ZZ$=INKEY$:GOSUB 7000:IF ZZ%<>13 AND ZZ%<>75 AND ZZ%<>73 THEN 3030
  222. 6215  IF X%=2 AND ZZ%=75 THEN 3030
  223. 6218  IF X%=2 THEN IF ZZ%=13 AND Y%<7 THEN 3030
  224. 6220  IF X%<>2 AND ZZ%=75 GOTO 3070
  225. 6230  IF X%=2 AND Y%<>7 THEN 3070
  226. 6240  IF X%=2 AND ZZ%=13 AND Y%=7 THEN Z1%=4:GOTO 3070
  227. 6250  GOTO 3030
  228. 7000  IF ZZ$<>"" THEN ZZ%=ASC(ZZ$) ELSE ZZ%=0
  229. 7005  IF ZZ%>96 THEN ZZ%=ZZ%-32
  230. 7010  RETURN
  231. 9996  '
  232. 9997  '***************
  233. 9998  '* Fake Cursor *
  234. 9999  '***************
  235. 10000  PRINT CHR$(29)CHR$(22);:FOR X=1 TO 25
  236. 10010  G$=INKEY$:IF G$<>"" THEN RETURN
  237. 10020  NEXT
  238. 10025  PRINTCHR$(29)" ";
  239. 10030  FOR X=1 TO 25
  240. 10040  G$=INKEY$:IF G$<>"" THEN RETURN
  241. 10050  NEXT
  242. 10060  GOTO 10000
  243.