home *** CD-ROM | disk | FTP | other *** search
/ Softdisk G-S 140 / SGDS 140.2mg / SDGS.140 / B / WORKHORSE (.txt) < prev    next >
Encoding:
Applesoft BASIC Source Code  |  1993-03-30  |  10.9 KB  |  108 lines  |  [FC] Applesoft BASIC Program (0x0801)

  1. 10 J = 19:C = 7:D = 7:Q$ =  CHR$(34): DIM P$(J),N$(19),I$(200),V(19):A$ = "MATH WORKHORSE": GOTO 80
  2. 30  POKE  -16368,0
  3. 40 A =  PEEK(49152): IF A <128  THEN 40
  4. 50  IF A = 155  THEN 120
  5. 70 A = A -128: POKE  -16368,0: RETURN 
  6. 80  DATA Analytic Geometry,ANALYTIC.GEOM,Bases,BASES,Combinations and Permutations,COMB.AND.PERM,Complex Numbers,COMPLEX.NUMBERS,"Congruences, etc.",CONGRUENCES,Constants and Formulas,CONSTANTS,Fractions,FRACTIONS,"F(X) and F(X,Y)",RUN
  7. 90  DATA Large Numbers,LARGE.NUMBERS,Linear Equations and Matrices,LIN.EQ.MATRICES,Polynomials of a Single Variable,POLYNOMIALS.INX,Prime Factors and Divisors of Integers,PRIME.FACTORS,Roots of a Polynomial,SOLVEPOLYNOMIAL   
  8. 95  DATA Statistics Values for 1 and 2 Variables,STAT,Trigonometry,TRIGONOMETRY,Documentation,DOCUMENTATION,Index,I,Disk CATALOG,D,Quit,Q
  9. 100  RESTORE : FOR K = 1 TO 19: READ P$(K),N$(K): NEXT :K = 1: ONERR  GOTO 115
  10. 111 V(K) = 0: PRINT "<CTRL-0x04>verify"N$(K):V(K) = 1
  11. 115 K = K +1: IF K <17  THEN 111
  12. 120 I =  PEEK(771):I = I *(I >0  AND I =  <J) +(I <1  OR I >J):V(17) = 1:V(18) = 1:V(19) = 1: CALL 54915:B = 0: GOSUB 360: PRINT A$" V3.0 by Spence (Micky) Earnshaw";: POKE 1403,53: PRINT "(c) 1993 by Softdisk, Inc.": PRINT 
  13. 130  POKE 1403,10: PRINT "Highlight your option with the arrow keys, then hit RETURN.": GOSUB 330: ONERR  GOTO 690
  14. 140  FOR K = 1 TO J: VTAB K +4: POKE 1403,18 -(K >9): IF V(K)  THEN  PRINT K". ";: GOTO 148
  15. 145  PRINT  SPC( 3 +(K >9));
  16. 148  PRINT P$(K): NEXT 
  17. 150  VTAB I +4: POKE 1403,21: INVERSE : PRINT P$(I);: NORMAL : POKE 771,I: GOSUB 30: IF A = 13  THEN 200
  18. 160  IF A < >8  AND A < >10  AND A < >11  AND A < >21  THEN 150
  19. 170  VTAB I +4: POKE 1403,21: PRINT P$(I);: IF A = 21  OR A = 10  THEN I = I +1: IF I >J  THEN I = 1
  20. 180  IF A = 8  OR A = 11  THEN I = I -1: IF I = 0  THEN I = J
  21. 190  GOTO 150
  22. 200  PRINT : HOME : IF I = 8  THEN M$(1) = "Find F(X) when F(X) is a polynomial":M$(2) = "Find F(X,Y) for a linear or quadratic polynomial":N = 2:V = C:E = 6:H = 17: GOSUB 260:C = V:I = 11: IF V -E = 2  THEN I = 1: ON V -E GOTO 420,370
  23. 210  IF I = 16  THEN  GOTO 660
  24. 220  IF I = 18  THEN  PRINT "<CTRL-0x04>CATALOG": PRINT : GOSUB 340: GOTO 120
  25. 230  ON I GOTO 370,590,600,400,530,630,580,10,620,470,420,500,450,390,550,10,740,10,700
  26. 240  VTAB 24: POKE 1403,25: INVERSE : PRINT "RETURN to run...ESC=Disk Menu";: NORMAL : GOSUB 30: HOME 
  27. 250  VTAB 9: POKE 1403,28: PRINT "Running "M$: PRINT : PRINT "<CTRL-0x04>RUN"M$
  28. 260  VTAB 1: POKE 1403,0: PRINT A$"  by Micky Earnshaw";: POKE 1403,66: PRINT "Esc=Disk Menu": GOSUB 330: POKE 1403,40 - LEN(P$(I))/2: PRINT P$(I): GOSUB 330: PRINT "Highlight your option with arrow keys or a number from 1 to "N"...then hit RETURN"
  29. 270  FOR K = 1 TO N: VTAB E +K: POKE 1403,H -3: PRINT K"."M$(K);: NEXT 
  30. 280  VTAB V: POKE 1403,H -1: INVERSE : PRINT M$(V -E);: NORMAL : GOSUB 30: IF A >48  AND A <49 +N  THEN  VTAB V: POKE 1403,H -1: PRINT M$(V -E);:V = A +E -48: GOTO 280
  31. 290  IF A = 13  THEN  HOME : PRINT : RETURN 
  32. 300  VTAB V: POKE 1403,H -1: PRINT M$(V -E): IF A = 21  OR A = 10  THEN V = V +1: IF V = E +1 +N  THEN V = E +1
  33. 310  IF A = 8  OR A = 11  THEN V = V -1: IF V = E  THEN V = E +N
  34. 320  GOTO 280
  35. 330  POKE 1403,0: FOR A = 1 TO 78: PRINT "=";: NEXT : PRINT "=": RETURN 
  36. 340  IF PR = 0  THEN  VTAB 24: POKE 1403,23: INVERSE : PRINT "RETURN to continue; ESC=Disk Menu";: NORMAL : GOSUB 30: HOME 
  37. 350  RETURN 
  38. 360  ONERR  GOTO 369
  39. 361  PRINT : PRINT "<CTRL-0x04>PR#0":PR = 0: PRINT "<CTRL-0x04>PR#3": TEXT : HOME : PRINT : VTAB 1: RETURN 
  40. 369  HOME : VTAB 10: PRINT " YOU NEED *) COLUMNS FOR MATH WORKHORSE!": PRINT : HTAB 11: PRINT "PRESS A KEY TO EXIT.": GET A$: PRINT "<CTRL-0x04>BYE"
  41. 370  GOSUB 670: PRINT "-Solves problems with/finds equations involving lines & points.<CTRL-0x0d><CTRL-0x0d>-Translates/rotates coordinate axes for points & linear/quadratic polynomials.<CTRL-0x0d><CTRL-0x0d>-Finds equations of circles and parabolas.": PRINT 
  42. 380  PRINT "-Identifies a general conic/quadratic polynomial.<CTRL-0x0d>": PRINT "-Finds F(X,Y), solution pairs (X,Y), and points of intersection for linear and   quadratic polynomials.<CTRL-0x0d>": PRINT "-Converts between rectangular & polar coordinates.": GOTO 240
  43. 390  GOSUB 670: PRINT "-Finds the Mean, Median, Mode, etc. for 1 and 2 variables.": PRINT : PRINT "-'Smooths' a finite set of ordinates.": GOTO 240
  44. 400 M$ = "COMPLEX.NUMBERS": GOSUB 670: PRINT "-Converts any complex number in standard form into polar & exponential form, and visa versa.": PRINT : POKE 1403,21: PRINT "FOR ANY COMPLEX NUMBER IN STANDARD FORM": PRINT : PRINT "-Raises it to a real or complex power.<CTRL-0x0d>"
  45. 410  PRINT "-Finds all N Nth roots for positive integral N<2001.<CTRL-0x0d>": PRINT "-Lists elementary functions (exponential, trigonometric, hyperbolic).<CTRL-0x0d>": PRINT "-Adds, subtracts, multiplies, and divides any 2 complex numbers.": GOTO 240
  46. 420  GOSUB 670: PRINT "FOR POLYNOMIALS TO DEGREE 100 WITH REAL COEFFICIENTS IN A SINGLE VARIABLE, X": PRINT 
  47. 430  PRINT "-Creates a polynomial with given roots - accepts both real & imaginary roots.": PRINT : PRINT "-Finds all N+1 derivatives, and the antiderivative.": PRINT : PRINT "-Multiplies or divides 2 polynomials.": PRINT 
  48. 440  PRINT "-Raises a polynomial to a positive integral power.": PRINT : PRINT "-Finds F(X) for any real or complex number X.": PRINT : PRINT "-Multiplies or divides all coefficients by a constant.": GOTO 240
  49. 450  GOSUB 670: POKE 1403,7: PRINT "FOR A POLYNOMIAL Y = F(X) WITH REAL COEFFICIENTS - TO DEGREE 50": PRINT : PRINT "-Finds real* roots. The program first looks for rational roots. It then searches for irrational roots.": PRINT 
  50. 460  PRINT "-Improves the accuracy of a known root.": VTAB 21: PRINT "*It will also find complex roots of any polynomial of degree 2 or 3 (including   the 'depressed' polynomial).": GOTO 240
  51. 470  GOSUB 670: PRINT "-Solves N simultaneous linear equations.<CTRL-0x0d><CTRL-0x0d>-Creates N simultaneous linear equations.<CTRL-0x0d><CTRL-0x0d>-Calculates up to a 7x7 determinant.<CTRL-0x0d><CTRL-0x0d>-Row reduces an MxN matrix.": PRINT 
  52. 480  PRINT "-Finds the inverse of an NxN matrix.": PRINT : PRINT "-Finds the transpose of an MxN matrix.": PRINT : PRINT "-Adds, subtracts, & multiplies 2 matrices. Raises a matrix to a power.": PRINT 
  53. 490  PRINT "-Finds coefficients of an Nth degree polynomial when N+1 values of X and the     corresponding F(X) are input.": VTAB 22: PRINT "Note: M and N can be any positive integers up to 25.": GOTO 240
  54. 500  GOSUB 670: PRINT "-Finds prime factors of, all divisors of, and integers relatively prime to       any integer less than 4,294,967,297.": PRINT 
  55. 510  PRINT "-Finds the greatest common divisor and the least common multiple of any number   of integers.": PRINT : PRINT "-Reduces a fraction to lowest terms.": PRINT 
  56. 520  PRINT "-Lists prime numbers or twin primes...": PRINT " -You determine the starting number, and the number": PRINT "  (a)up to which primes are listed.": PRINT "  (b)of primes that are listed.": GOTO 240
  57. 530  GOSUB 670: PRINT "-Finds solutions in integers for a linear equation in 2 unknowns with integral   coefficients.": PRINT : PRINT "-Solves a single linear congruence.<CTRL-0x0d><CTRL-0x0d>-Solves up to 30 simultaneous linear congruences."
  58. 540  PRINT : PRINT "-Represents A/B as a continued fraction, and vice versa.": PRINT : PRINT "-Lists quadratic residues modulo M.": PRINT : PRINT "-Finds the GCD and LCM of up to 30 numbers.": GOTO 240
  59. 550  GOSUB 670: PRINT "-Converts angles between degrees-radians-gradients-deg/min/sec, and lists the    6 trigonometric functions in any one of these 4 modes.": PRINT : PRINT "-Solves any triangle - input 3 pieces ";
  60. 560  PRINT "of information and get back 3 sides,": PRINT " 3 angles, 3 altitudes, the area, and the radii of the inscribed and             circumscribed circles. Gives BOTH solutions of ambiguous cases."
  61. 570  PRINT : PRINT "-Solves equations of the form AsinX + BcosX = C, for X.": GOTO 240
  62. 580  GOSUB 670: PRINT "-Adds, subtracts, multiplies, & divides fractions.": PRINT : PRINT "-Reduces a fraction to lowest terms.": PRINT : PRINT "-Converts a repeating decimal number into a proper fraction.": GOTO 240
  63. 590  GOSUB 670: PRINT "-Converts a number (integer or decimal) in one base into its equivalent in any   other base - from base 2 to base 36.": GOTO 240
  64. 600 M$ = "COMB.AND.PERM.": GOSUB 670: PRINT "-Lists all permutations or combinations of N characters taken M at a time.<CTRL-0x0d>": PRINT " Choose the N characters yourself, or let the computer choose. You decide        whether repetition of characters is";
  65. 610  PRINT " permitted.": PRINT : PRINT "-Lists N! (N Factorial) for N=0 to N=36.": GOTO 240
  66. 620  GOSUB 670: PRINT "-Adds, subtracts, multiplies, divides and raises to a positive integral power    decimal numbers up to 250 digits long.": PRINT : PRINT "-Calculates N! (N Factorial) for N=0 to N=257.": GOTO 240
  67. 630  GOSUB 670: PRINT "-Lists the values of pi and e to 24 decimal places (along with some close        rational approximations to each).": PRINT : PRINT "-Lists conversion constants between degrees and radians.": PRINT 
  68. 640  PRINT "-Lists the first 57 Fibonacci Numbers.": PRINT : PRINT "-Lists N! (N Factorial) for N=0 to N=36."
  69. 650  PRINT : PRINT "-Lets you play with the 1st 5000 decimal digits of pi.": PRINT : PRINT "-Lists formulas for the most common plane and solid geometric figures.": GOTO 240
  70. 660  GOSUB 670: PRINT "-Prints documentation on your printer or on the screen for the "A$: PRINT " collection of programs.": GOTO 240
  71. 670 M$ = N$(I): VTAB 1: INVERSE : POKE 1403,40 - LEN(M$)/2: PRINT M$;: NORMAL : IF F = 10  THEN  PRINT " Disk "Q(I);
  72. 680  PRINT : PRINT : POKE 1403,29: PRINT "- The program above -": VTAB 5: RETURN 
  73. 690  IF B = 0  THEN  HOME : VTAB 7: PRINT M$" was not found!<CTRL-0x07><CTRL-0x07>": PRINT : PRINT "Please insert the correct disk into the currently active disk drive.": GOTO 240
  74. 700 B = 1: HOME :M$(1) = "Return to the Disk Menu":M$(2) = "Quit":N = 2:H = 24:V = 7:E = 6: GOSUB 260: IF V -E = 1  THEN 120
  75. 710  PRINT "<CTRL-0x04>BYE"
  76. 730  FOR A = 1 TO 6:M$(A) = "Boot up a disk in slot #" + STR$(A +(A >2)): NEXT :N = 6:V = 7:E = 6:H = 28: GOSUB 260: PRINT "<CTRL-0x04>PR#"; RIGHT$(M$(V -E),1)
  77. 740  POKE 1403,30: INVERSE : PRINT A$" Index": NORMAL : POKE 1403,11: PRINT "Numbers in [ ] after entries refer to the programs below.": GOSUB 330: VTAB 1: POKE 1403,0: PRINT "Arrow keys:Advance/Retreat";: POKE 1403,66: PRINT "ESC:Disk Menu": VTAB 4
  78. 750  PRINT " 1. ANALYTIC GEOM.   2. BASES            3. COMB.AND.PERM    4. COMPLEX NUMBERS": PRINT " 5. CONGRUENCES      6. CONSTANTS        7. DOCUMENTATION    8. FRACTIONS"
  79. 760  PRINT " 9. LARGE NUMBERS   10. LIN.EQ.MATRICES 11. POLYNOMIALS.INX 12. PRIME FACTORS": PRINT "13. SOLVE POLYS     14. STATISTICS      15. TRIGONOMETRY": GOSUB 330: POKE 34,8:H = 1: IF Z  THEN 990
  80. 765  FOR Z = 1 TO 117: READ I$(Z): NEXT 
  81. 770  DATA "Add, subtract, multiply, divide..."," -complex numbers [4]"," -fractions [8]"," -matrices [10]"," -polynomials [11]"," -real numbers [9]"
  82. 780  DATA Analytic geometry [1],Angle...," -between 2 lines [1]"," -convert between [15]"," -of a complex number [4]",Antiderivative of a polynomial [1]
  83. 790  DATA Average [14],Bases [2],Binomial Coefficients [6],"Circles [1,6]",Combinations [3],"Complex numbers [4,11,13]"
  84. 800  DATA Congruences [5],"Conics [1,6]",Constants [6],Continued fractions [5],Convert between...," -angles [15]" 
  85. 810  DATA " -complex number representations [4]"," -constants [6]"," -decimals & proper fractions [8]"
  86. 820  DATA " -number systems [2]"," -rectangular & polar coordinates [1]","Coordinate points, finite [14]",Correlation Coefficient [14]
  87. 830  DATA "Create, with N chosen roots..."," -a polynomial Y=F(X) [11]"
  88. 840  DATA " -N linear equations [10]",Derivatives of a polynomial [11],Determinants [10],Diophantine linear equations [5],Divisors of an integer [12]
  89. 850  DATA Documentation [7],e [6],Equation of...," -AsinX + BcosX =C [15]"," -circle [1]"," -conic[1]"
  90. 860  DATA " -linear diophantine equation [5]"," -parabola [1]"," -polynomial Y=F(X) [1,10,11,13]","Factorials [3,9]",Factors of an integer [12],Fibonacci numbers [6]
  91. 870  DATA Formulas [6],"Fractions [8,12]","F(X), find when given X [11]","F(X,Y), find when given X & Y [1]",Geometry formulas [6],Greatest common divisor [12]
  92. 880  DATA "Imaginary numbers [4,11,13]",Intercepts [1],Intersection points [1],Inverse of a matrix [10],Large (real) numbers [9]
  93. 890  DATA Least common multiple [12],Linear...," -congruences [5]"," -equations [1,5,10,11,13]",Lines [1],Matrices [10],Mean [14],Median [14]
  94. 900  DATA Mode [14],Parabola [1],Permutations [3],pi [6]
  95. 910  DATA Points [1],Polar...," -form of a complex number [4]"," -to Cartesian conversion [1]"
  96. 920  DATA Polynomials...," -in X [1,10,11,13]"," -in X & Y [1,5,10]",Powers...," -complex numbers [4]"," -matrices [10]"
  97. 930  DATA " -polynomials [11]"," -real numbers [9]",Prime factors [12],Prime numbers [12],Quadratic residues [5],"Ratio, divide a line segment into [1]"
  98. 940  DATA "Reduce a fraction [8,12]",Regression line [14],Residue system [12],Roots of...," -AsinX + BcosX = C [15]"," -complex numbers [4]"  
  99. 950  DATA " -linear equations [1,5,10,13]"," -linear congruences [5]"," -polynomials in 1 variable [1,11,13]"," -polynomials in 2 variables [1,5,10]"
  100. 960  DATA Rotate coordinate axes [1],Row reduce a matrix [10],Slope [1],Solve a...," -conic [1]"," -polynomial Y=F(X), given N values"
  101. 970  DATA "   of X & F(X) [10]"," -triangle [15]"," -also, see Roots",Standard Deviation [14],Statistics [14],Translate coordinate axes [1]
  102. 980  DATA Transpose of a matrix [10],Triangle...," -formulas for [6]"," -solution of [15]","Trigonometry [4,15]",Twin primes [12]
  103. 990  HOME : FOR A = H TO H +14: PRINT I$(A);: POKE 1403,39: PRINT I$(A +15): NEXT 
  104. 1000  GOSUB 30: IF A = 8  OR A = 11  THEN H = (H -30) *(H >30) +( INT(Z/30) *30 +1) *(H =  <30): GOTO 990
  105. 1010  IF (A = 10  OR A = 13  OR A = 21)  AND H +29 <Z  THEN H = H +30: GOTO 990
  106. 1020  IF A = 10  OR A = 13  OR A = 21  THEN H = 1: GOTO 990
  107. 1030  IF A = 27  THEN 120
  108. 1040  GOTO 1000