esercizi di chimica con turbo pascal 1.1 su mac

Program evapora;
(* leggi della EVAPORAZIONE *)
   USES Memtypes,QuickDraw,OSIntf,ToolIntf;
   
   VAR
      gPort:   GrafPort;           
      gra1,gra2,gomma,cancella:rect;
      a:integer;
      sx:string;
      
procedure pausa; (* attesa che si prema enter *)
begin
moveto(10,10);drawstring('premi enter ');readln;
end;
  
  procedure grafica;  (* attivazione comandi grafici *)
BEGIN
   InitGraf(@thePort);      
   initfonts;
   InitCursor;
   HideCursor;
   OpenPort(@gPort); 
   textfont(9);
   textface([outline]);  
   PenPat(white);
   BackPat(Black);
   EraseRect(gPort.portRect);
   FrameRect(gPort.portRect);
end;
procedure testo(x,y:integer;frase:string);
begin 
penpat(white);
moveto(x,y);drawstring(frase);
end;
procedure sosta;
begin
for a:=1 to 10000 do
write('');
end;
procedure sosta1;
begin
for a:=1 to 5000 do
write('');
end;
procedure cancellatesto;
begin
setrect(cancella,10,10,500,100);
penpat(black);
paintrect(cancella);
end;
procedure cancellagrafo;
begin
setrect(gomma,1,1,500,370);
penpat(black);
paintrect(gomma);
end;
procedure diagramma;
begin
moveto(50,200);lineto(50,340);lineto(400,340);
moveto(50,190);drawstring('vapore generato a paritˆ di condizioni');
moveto(50,360);drawstring('temperatura,superficie,aereazione');
moveto(50,340);lineto(400,200);drawstring('sostanza B');
moveto(50,340);lineto(400,250);drawstring('sostanza A');
moveto(300,340);lineto(300,200);
moveto(70,210);drawstring('V = f(T,S,A,X) ');
end;
procedure moto1(durata:integer);
label salta;
var x1,x2,y1,y2:integer;
begin
x1:=100;x2:=300;y1:=100;y2:=100;
setrect(gra1,x1-5,y1,x1+95,y1+200);paintrect(gra1);
setrect(gra2,x2-5,y1,x2+95,y1+200);paintrect(gra2);
moveto(x1,320);drawstring('liquido in A');
moveto(x2,320);drawstring('liquido in B');
for a:=1 to durata do
begin
penpat(white);
moveto(x1,y1+2);lineto(x1+90,y1+2);
moveto(x2,y2+2);lineto(x2+90,y2+2);
if (a=durata -1) then goto salta;sosta1;
penpat(black);
moveto(x1,y1);lineto(x1+90,y1);
moveto(x2,y2);pensize(2,2);lineto(x2+90,y2);
y1:=y1+1;y2:=y2+2;
end;
salta:
end;
procedure moto1a(durata:integer);
label salta;
var x1,x2,y1,y2:integer;
begin
x1:=100;x2:=300;y1:=100;y2:=100;
setrect(gra1,x1-5,y1,x1+95,y1+200);paintrect(gra1);penpat(gray);
setrect(gra2,x2-5,y1,x2+95,y1+200);paintrect(gra2);
moveto(x1,320);drawstring('liquido in A');
moveto(x2,320);drawstring('liquido in B');
for a:=1 to durata do
begin
penpat(white);
moveto(x1,y1+2);lineto(x1+90,y1+2);
moveto(x2,y2+2);lineto(x2+90,y2+2);
if (a=durata -1) then goto salta;sosta1;
penpat(black);
moveto(x1,y1);lineto(x1+90,y1);
moveto(x2,y2);pensize(2,2);lineto(x2+90,y2);
y1:=y1+1;y2:=y2+2;
end;
salta:
end;
procedure moto2(durata:integer);
label salta;
var x1,x2,y1,y2:integer;
begin
x1:=100;x2:=250;y1:=100;y2:=100;
setrect(gra1,x1-5,y1,x1+95,y1+200);paintrect(gra1);
setrect(gra2,x2-5,y1,x2+195,y2+200);paintrect(gra2);
moveto(x1,320);drawstring('liquido in A');
moveto(x2,320);drawstring('liquido in B');
for a:=1 to durata do
begin
penpat(white);
moveto(x1,y1+1);lineto(x1+90,y1+1);
moveto(x2,y2+1);lineto(x2+190,y2+1);
if (a=durata -1) then goto salta;sosta1;
penpat(black);
moveto(x1,y1);lineto(x1+90,y1);
moveto(x2,y2);pensize(2,2);lineto(x2+190,y2);
y1:=y1+1;y2:=y2+1;
end;
salta:
end;
procedure pro1;
begin
testo(20,30,'LIQUIDO in A = LIQUIDO in B');
testo(20,50,'TEMPERATURA A < TEMPERATURA B ');
moto1(70);
testo(20,70,'V.EVAPORAZIONE A < V.EVAPORAZIONE B ');sosta;
testo(20,340,'vapore generato varia con la temperatura');
testo(20,360,'V = f(T) ');testo(50,370,sx);pausa;
end;
procedure pro2;
begin
testo(20,30,'LIQUIDO in A diverso da LIQUIDO in B');
testo(20,50,'TEMPERATURA A = TEMPERATURA B ');
moto1a(70);
testo(20,70,'V.EVAPORAZIONE A < V.EVAPORAZIONE B ');sosta;
testo(20,340,'vapore generato varia con la natura del liquido');
testo(20,360,'V = f(x) ');testo(50,370,sx);pausa;
end;
procedure pro3;
begin
testo(20,30,'LIQUIDO in A = LIQUIDO in B');
testo(20,50,'TEMPERATURA A = TEMPERATURA B ');
testo(20,70,'SUPERFICIE in A < SUPERFICIE in B ');
moto2(70);
testo(20,90,'V.EVAPORAZIONE A < V.EVAPORAZIONE B ');sosta;
testo(20,340,'vapore generato varia con la superficie evaporante');
testo(20,360,'V = f(S) ');testo(50,370,sx);pausa;
end;
procedure pro4;
begin
testo(20,30,'LIQUIDO in A = LIQUIDO in B');
testo(20,50,'TEMPERATURA A = TEMPERATURA B ');
testo(20,70,'SUPERFICIE in A = SUPERFICIE in B ');
moveto(80,95);pensize(5,5);lineto(210,95);pensize(1,1);moto1(70);
testo(20,90,'V.EVAPORAZIONE A < V.EVAPORAZIONE B ');sosta;
testo(20,340,'vapore generato varia con aerazione:A chiuso,B aperto');
testo(20,360,'V = f(A) ');testo(50,370,sx);pausa;
end;
procedure pro5;
begin
testo(20,20,'dalle osservazioni sperimentali si deduce che');
testo(20,40,'la quantitˆ di vapore che si genera a paritˆ di tempo');
testo(20,60,'o VELOCITA di VAPORIZZAZIONE,dipende da diversi fattori:');
sosta;
testo(20,80,'1-aumenta se aumenta la temperatura ----------- V =f(T)');
sosta;
testo(20,100,'2-aumenta se aumenta la superficie evaporante-- V =f(S)');
sosta;
testo(20,120,'3-aumenta se aumenta la ventilazione ---------- V = f(A)');
sosta;
testo(20,140,'4-a paritˆ di condizioni,varia con la sostanza- V = f(X)');
testo(20,150,'---------------------------------------------------------');
pausa;
diagramma;testo(50,370,sx);pausa;
end;
procedure pro6;
begin
testo(20,20,'per la interpretazione cfr.testo');pausa;
end;
procedure fine;  (* conferma uscita operazione *)
begin
writeln('fine operazione:confermare :premi enter');
readln;
end;
procedure scelta;  (* procedura con scelta opzioni e uscita *)
var s,sn:string;opzione:integer;
begin
clearscreen;
writeln('seleziona opzione per LEGGI DELLA EVAPORAZIONE');
writeln('1...evaporazione in funzione della temperatura ');
writeln('2...evaporazione in funzione della natura dei liquidi ');
writeln('3...evaporazione in funzione della superficie evaporante ');
writeln('4...evaporazione in funzione della aerazione ');
writeln('5...conclusioni:leggi della evaporazione');
writeln('6...interpretazione fenomeno ');
writeln('9...fine ');
writeln('scelta =');readln(opzione);
grafica;
case opzione of
1:pro1;2:pro2;3:pro3;4:pro4;5:pro5;6:pro6;
9:fine;
end;
EraseRect(gPort.portRect);
writeln('altra operazione?Esperimenti?:premi S...fine:premi N '); readln(sn);
if ((sn='S') or (sn='s')) then scelta ;
end;
begin            (* programma di lancio *)
clearscreen;
sx:='prendi nota del disegno e del testo,poi ENTER';
writeln;writeln;
writeln('esperimento per ricavare le leggi della evaporazione');
writeln('dispositivi necessari:');
writeln('1-recipienti con superficie uguale e diversa,chiusi e aperti');
writeln('2-termometri ');
writeln('3-cronometro');
writeln('4-liquidi diversi:es.acqua,etere,alcool...');
writeln('EVAPORAZIONE:passaggio dallo stato liquido a quello di vapore');
writeln('mediante assorbimento di calore dallo ambiente esterno:');
writeln('interessa il liquido in superficie,avviene ad ogni temperatura,');
writeln('in modo impercettibile:si nota la variazione del livello del ');
writeln('liquido nel recipiente che lo contiene ');
pausa;clearscreen;
scelta;
end.