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 >
Wrap
Pascal/Delphi Source File
|
1984-07-01
|
8KB
|
180 lines
(*******************************************************************)
(* *)
(* Master Program to control Math21, Math22, Ohm1, and Ohm2. *)
(* Additional programs will be added when completed. *)
(* *)
(*******************************************************************)
Program Control;
Var Cohm1,Cohm2,Cmath21,Cmath22 : File;
Xlow,Yhi,Hlen,Vlen,I : Integer;
Ch,Zh : Char;
{---------------------------------------------------------------}
Procedure Key; Begin
Gotoxy(27,25); Write(' Press any key ');
Repeat until Keypressed;
Gotoxy(26,25); Write(' ');
end; (* Procedure Key.*)
{---------------------------------------------------------------}
Procedure Boxes; (* Upper left corner x,y and side *)
(* lengths come from calling program. *)
Var Hl, Vl, Ur, Ul, Ll, Lr : Char; (* Lines and Corners. *)
Begin
Hl:=Char(196); Vl:=Char(179);
Ur:=Char(191); Ul:=Char(218); Ll:=Char(192); Lr:=Char(217);
Gotoxy(Xlow, Yhi); Write(Ul); (* Position upper left corner. *)
For I:=1 to Hlen do begin (* Write top line and corners. *)
Write(Hl);
end;
Write(Ur);
Xlow:=Xlow+Hlen+1; (* X is same for vertical. *)
For I:=1 to Vlen do begin (* Write R vertical and corner.*)
Yhi:=Yhi+1;
Gotoxy(Xlow, Yhi);
Write(Vl);
end;
Gotoxy(Xlow, Yhi+1); Write(Lr);
Yhi:=Yhi+1;
For I:=1 to Hlen do begin (* Y same for horizontal.*)
Xlow:=Xlow-1;
Gotoxy(Xlow, Yhi);
Write(Hl);
end;
Gotoxy(Xlow-1, Yhi); Write(Ll);
Xlow:=Xlow-1; (* X same for vertical. *)
For I:=1 to Vlen do begin
Yhi:=Yhi-1;
Gotoxy(Xlow, Yhi);
Write(Vl);
end;
end; (* Procedure Boxes. *)
{---------------------------------------------------------------}
Procedure MainControl; Forward;
Procedure Explain;
Begin
Gotoxy(1,3);Clrscr;
Writeln(' New Kinds of Programs for Learning ');
Writeln(' the FOUNDATIONS of SCIENCE and MATHEMATICS ');
Writeln(' ------------------------------------------ ');
Writeln;
Writeln(' The programs on this disk are of two types: ');
Writeln;
Writeln(' 1. Mathematics essential for science. ');
Writeln(' 2. Electronics as a portion of science. ');
Writeln;
Writeln(' Programs like this have not been written before. ');
Writeln(' The viewpoint they represent is this: ');
Writeln;
Writeln(' Assume that a person is learning at home, or where a minimum of ');
Writeln(' assistance is available. What information is suitable for him ');
Writeln(' as he learns? We are referring to learning on the basic level, ');
Writeln(' and continuing on, as a unified whole, through college level ');
Writeln(' material. ');
Writeln;
Writeln(' These programs are aimed at providing much of that information. ');
Writeln(' ______________________________________________________ ');
Key; Clrscr;
Gotoxy(1,3);
Writeln(' Existing materials for learning science and mathematics are wri- ');
Writeln(' ten with a certain orientation. The subjects are taught in col- ');
Writeln(' leges, and the people who teach write the books. The orientat- ');
Writeln(' ion is thus towards college-classroom teaching. Piece-mealed, ');
Writeln(' tunnel-visioned materials inevitably result. We need materials ');
Writeln(' that are "learner oriented," and that span the whole of the fou- ');
Writeln(' undations of science and mathematics, including computers. ');
Writeln;
Writeln(' The tasks of preparing these new materials are far too large for ');
Writeln(' one person. Consider the programs here as "seed materials." I ');
Writeln(' hope that others will write them too as public domain offerings. ');
Writeln;
Writeln(' My own work is continuing. Two additional programs have been ');
Writeln(' started. They are: Systems of Linear Equations, and Maxwell`s ');
Writeln(' Loop Equations for Electronic Networks. All electronics demon- ');
Writeln(' strations can be done at home with a modest amount of equipment. ');
Writeln(' "Hands on" experiments are essential for learning science and ');
Writeln(' useful applications of mathematics. ');
Writeln(' ------------------------------------------------------------ ');
Writeln(' Robert G. Hoffmann October 1985. ');
Writeln(' 5044 Allisonville Rd., Apt F ');
Writeln(' Indianapolis, Indiana 46205 ');
Gotoxy(22,25);Write('Press `M` for Menu, `Q` to Quit.');
Repeat
Read(Kbd,ch);
ch:=UpCase(ch);
until (Ch in ['M','Q']);
Gotoxy(14,25);Write(' ');
If Ch='M' then MainControl;
If Ch='Q' then Halt;
end; (* Procedure Explain. *)
{---------------------------------------------------------------}
Procedure MainControl; (******** MAIN CONTROL *********)
Begin
Assign(Cohm1,'Ohm1.com');
Assign(Cohm2,'Ohm2.com');
Assign(Cmath21,'Math21.com');
Assign(Cmath22,'Math22.com');
Clrscr;
Gotoxy(1,1);
Writeln(' New Approaches to Learning ');
Writeln;
Writeln(' the FOUNDATIONS of MATHEMATICS and SCIENCE ');
Gotoxy(1,6);
Writeln(' Four programs in the Series are on this disk, as listed ');
Writeln(' below. Each may be removed and run separately too. ');
Writeln;
Writeln(' Select no. 5. for additional information. ');
Xlow:=7; Yhi:=5; Hlen:=62; Vlen:=4; Boxes;
Gotoxy(5,13);Write('1 Equations and straight lines. ');
Gotoxy(5,14);Write('2 Triangles & Pythagoras`s Theorem. ');
Gotoxy(40,13);Write(' 3 Ohm`s Law & Linear Equations. ');
Gotoxy(40,14);Write(' 4 Series-Parallel Circuits. ');
Gotoxy(10,16);Write(' 5 Description of approach. Q Quit program. ');
Gotoxy(10,17);Write(' -------------------------------------------- ');
Gotoxy(1,21);
Writeln(' (*******************************) ');
Writeln(' (* *) ');
Writeln(' (* PUBLIC DOMAIN MATERIALS *) ');
Writeln(' (* *) ');
Write(' (*******************************) ');
Gotoxy(70,25);Write('Oct 1985');
Gotoxy( 1,25);Write('Control');
Gotoxy(16,19);Write(' Press key for topic of choice -');
Repeat
Read(Kbd,Zh);
Zh:=Upcase(Zh);
until (Zh in ['1','2','3','4','5','Q']);
Case Zh of
'1': Execute(Cmath21);
'2': Execute(Cmath22);
'3': Execute(Cohm1);
'4': Execute(Cohm2);
'5': Explain;
'Q': Halt;
end; (* Case *)
Key;
end; (* Procedure MainControl.)
{===================================================================}
(********* MAIN PROGRAM ***********)
Begin
MainControl;
end.
{===================================================================}