home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / miscpas.zip / CONTROL.PAS < prev    next >
Pascal/Delphi Source File  |  1984-07-01  |  8KB  |  180 lines

  1. (*******************************************************************)
  2. (*                                                                 *)
  3. (*    Master Program to control Math21, Math22, Ohm1, and Ohm2.    *)
  4. (*        Additional programs will be added when completed.        *)
  5. (*                                                                 *)
  6. (*******************************************************************)
  7.  
  8. Program Control;
  9. Var   Cohm1,Cohm2,Cmath21,Cmath22 : File;
  10.              Xlow,Yhi,Hlen,Vlen,I : Integer;
  11.                             Ch,Zh : Char;
  12.   {---------------------------------------------------------------}
  13. Procedure Key;  Begin
  14.   Gotoxy(27,25); Write(' Press any key ');
  15.   Repeat until Keypressed;
  16.   Gotoxy(26,25); Write('                   ');
  17. end;   (* Procedure Key.*)
  18.   {---------------------------------------------------------------}
  19. Procedure Boxes;         (*  Upper left corner x,y and side    *)
  20.                          (* lengths come from calling program. *)
  21.  
  22.  Var Hl, Vl, Ur, Ul, Ll, Lr : Char;      (* Lines and Corners. *)
  23.  
  24. Begin
  25.  Hl:=Char(196); Vl:=Char(179);
  26.  Ur:=Char(191); Ul:=Char(218); Ll:=Char(192); Lr:=Char(217);
  27. Gotoxy(Xlow, Yhi);   Write(Ul);     (* Position upper left corner. *)
  28.   For I:=1 to Hlen do begin         (* Write top line and corners. *)
  29.      Write(Hl);
  30.   end;
  31.     Write(Ur);
  32.     Xlow:=Xlow+Hlen+1;              (*   X is same for vertical.    *)
  33.   For I:=1 to Vlen do begin         (*  Write R vertical and corner.*)
  34.     Yhi:=Yhi+1;
  35.       Gotoxy(Xlow, Yhi);
  36.         Write(Vl);
  37.   end;
  38. Gotoxy(Xlow, Yhi+1);  Write(Lr);
  39.     Yhi:=Yhi+1;
  40.   For I:=1 to Hlen do begin         (*  Y same for horizontal.*)
  41.     Xlow:=Xlow-1;
  42.       Gotoxy(Xlow, Yhi);
  43.         Write(Hl);
  44.   end;
  45. Gotoxy(Xlow-1, Yhi);  Write(Ll);
  46.     Xlow:=Xlow-1;                   (*  X same for vertical. *)
  47.   For I:=1 to Vlen do begin
  48.     Yhi:=Yhi-1;
  49.       Gotoxy(Xlow, Yhi);
  50.         Write(Vl);
  51.   end;
  52. end;   (* Procedure Boxes. *)
  53.   {---------------------------------------------------------------}
  54.                         Procedure MainControl; Forward;
  55. Procedure Explain;
  56.   Begin
  57.     Gotoxy(1,3);Clrscr;
  58. Writeln('                      New Kinds of Programs for Learning                 ');
  59. Writeln('                  the FOUNDATIONS of SCIENCE and MATHEMATICS            ');
  60. Writeln('                  ------------------------------------------            ');
  61.   Writeln;
  62. Writeln('                  The programs on this disk are of two types:           ');
  63.   Writeln;
  64. Writeln('                    1. Mathematics essential for science.               ');
  65. Writeln('                    2. Electronics as a portion of science.             ');
  66.   Writeln;
  67. Writeln('              Programs like this have not been written before.   ');
  68. Writeln('                   The viewpoint they represent is this:         ');
  69.   Writeln;
  70. Writeln('       Assume that a person is learning at home, or where a minimum of  ');
  71. Writeln('       assistance is available.  What information is suitable for him   ');
  72. Writeln('       as he learns?  We are referring to learning on the basic level,  ');
  73. Writeln('       and continuing on, as a unified whole, through college level     ');
  74. Writeln('       material.                                                        ');
  75.   Writeln;
  76. Writeln('       These programs are aimed at providing much of that information.  ');
  77. Writeln('           ______________________________________________________      ');
  78.  
  79.   Key; Clrscr;
  80.   Gotoxy(1,3);
  81. Writeln('       Existing materials for learning science and mathematics are wri- ');
  82. Writeln('       ten with a certain orientation.  The subjects are taught in col- ');
  83. Writeln('       leges, and the people who teach write the books.  The orientat-  ');
  84. Writeln('       ion is thus towards college-classroom teaching.   Piece-mealed,  ');
  85. Writeln('       tunnel-visioned materials inevitably result.  We need materials  ');
  86. Writeln('       that are "learner oriented," and that span the whole of the fou- ');
  87. Writeln('       undations of science and mathematics, including computers.       ');
  88.   Writeln;
  89. Writeln('       The tasks of preparing these new materials are far too large for ');
  90. Writeln('       one person.  Consider the programs here as "seed materials."  I  ');
  91. Writeln('       hope that others will write them too as public domain offerings. ');
  92.   Writeln;
  93. Writeln('       My own work is continuing.  Two additional programs have been    ');
  94. Writeln('       started.  They are: Systems of Linear Equations, and Maxwell`s   ');
  95. Writeln('       Loop Equations for Electronic Networks.  All electronics demon- ');
  96. Writeln('       strations can be done at home with a modest amount of equipment.   ');
  97. Writeln('       "Hands on" experiments are essential for learning science and    ');
  98. Writeln('       useful applications of mathematics.                              ');
  99. Writeln('         ------------------------------------------------------------   ');
  100. Writeln('       Robert G. Hoffmann                                October 1985.  ');
  101. Writeln('       5044 Allisonville Rd., Apt F                                     ');
  102. Writeln('       Indianapolis, Indiana  46205                                     ');
  103.  
  104. Gotoxy(22,25);Write('Press `M` for Menu, `Q` to Quit.');
  105.  
  106.   Repeat
  107.     Read(Kbd,ch);
  108.     ch:=UpCase(ch);
  109.   until (Ch in ['M','Q']);
  110. Gotoxy(14,25);Write('                                                     ');
  111.  
  112. If Ch='M' then MainControl;
  113. If Ch='Q' then Halt;
  114.  
  115. end;  (* Procedure Explain. *)
  116.   {---------------------------------------------------------------}
  117. Procedure MainControl;      (******** MAIN CONTROL *********)
  118. Begin
  119.        Assign(Cohm1,'Ohm1.com');
  120.        Assign(Cohm2,'Ohm2.com');
  121.        Assign(Cmath21,'Math21.com');
  122.        Assign(Cmath22,'Math22.com');
  123.  
  124. Clrscr;
  125.   Gotoxy(1,1);
  126. Writeln('                        New Approaches to Learning           ');
  127.   Writeln;
  128. Writeln('                the FOUNDATIONS of MATHEMATICS and SCIENCE   ');
  129.   Gotoxy(1,6);
  130. Writeln('          Four programs in the Series are on this disk, as listed ');
  131. Writeln('            below.  Each may be removed and run separately too.     ');
  132.   Writeln;
  133. Writeln('                 Select no. 5. for additional information.   ');
  134.  
  135.   Xlow:=7; Yhi:=5; Hlen:=62; Vlen:=4;  Boxes;
  136. Gotoxy(5,13);Write('1 Equations and straight lines.     ');
  137. Gotoxy(5,14);Write('2 Triangles & Pythagoras`s Theorem. ');
  138. Gotoxy(40,13);Write('  3 Ohm`s Law & Linear Equations.  ');
  139. Gotoxy(40,14);Write('  4 Series-Parallel Circuits.      ');
  140.  
  141. Gotoxy(10,16);Write('       5 Description of approach.   Q Quit program.  ');
  142. Gotoxy(10,17);Write('       --------------------------------------------  ');
  143.   Gotoxy(1,21);
  144. Writeln('                    (*******************************)  ');
  145. Writeln('                    (*                             *)  ');
  146. Writeln('                    (*   PUBLIC DOMAIN MATERIALS   *)  ');
  147. Writeln('                    (*                             *)  ');
  148.   Write('                    (*******************************)  ');
  149.  
  150. Gotoxy(70,25);Write('Oct 1985');
  151. Gotoxy( 1,25);Write('Control');
  152.  
  153. Gotoxy(16,19);Write('      Press key for topic of choice -');
  154.   Repeat
  155.     Read(Kbd,Zh);
  156.     Zh:=Upcase(Zh);
  157.   until (Zh in ['1','2','3','4','5','Q']);
  158.  
  159.     Case Zh of
  160.       '1': Execute(Cmath21);
  161.       '2': Execute(Cmath22);
  162.       '3': Execute(Cohm1);
  163.       '4': Execute(Cohm2);
  164.       '5': Explain;
  165.       'Q': Halt;
  166.     end; (* Case *)
  167.   Key;
  168. end;  (* Procedure MainControl.)
  169. {===================================================================}
  170.                    (*********   MAIN PROGRAM   ***********)
  171. Begin
  172.   MainControl;
  173.  
  174. end.
  175. {===================================================================}
  176.  
  177.  
  178.  
  179.  
  180.