esercizi di chimica con turbo pascal 1.1 su mac

Program ossidi;
(* nomenclatura composti chimici ANIDRIDI OSSIDI CON VALUTAZIONE *)
(* con presentazione finale risposte inserite    *)
   USES Memtypes,QuickDraw,OSIntf,ToolIntf,fixmath;
 const k1=16;k2=10;  
 
var esatte,errate,totale,a:integer;
    ris,rip,sx,sy,z,sm:string;
    fx:array[1..k1] of string;
    nx:array[1..k1] of string;
    ny:array[1..k1] of string;
    mx:array[1..k2] of string;
    my:array[1..k2] of string;
    
procedure dati;
begin
fx[1]:='SO2';fx[2]:='CO2';fx[3]:='SO3';fx[4]:='N2O3';
fx[5]:='Cl2O';fx[6]:='N2O5';fx[7]:='Cl2O3';fx[8]:='P2O3';
fx[9]:='Cl2O7';fx[10]:='P2O5';fx[11]:='Cl2O5';fx[12]:='Br2O';
fx[13]:='I203';fx[14]:='F2O';fx[15]:='Br2O5';fx[16]:='I2O7';
nx[1]:='ZOLFO4';nx[2]:='CARBONIO4';nx[3]:='ZOLFO6';nx[4]:='AZOTO3';
nx[5]:='CLORO1';nx[6]:='AZOTO5';nx[7]:='CLORO3';nx[8]:='FOSFORO3';
nx[9]:='CLORO7';nx[10]:='FOSFORO5';nx[11]:='CLORO5';nx[12]:='BROMO1';
nx[13]:='IODIO3';nx[14]:='FLUORO1';nx[15]:='BROMO5';nx[16]:='IODIO7';    
ny[1]:='SOLFOROSA';ny[2]:='CARBONICA';ny[3]:='SOLFORICA';
ny[4]:='NITROSA';ny[5]:='IPOCLOROSA';ny[6]:='NITRICA';
ny[7]:='CLOROSA';ny[8]:='FOSFOROSA';ny[9]:='PERCLORICA';
ny[10]:='FOSFORICA';ny[11]:='CLORICA';ny[12]:='IPOBROMOSA';
ny[13]:='IODOSA';ny[14]:='IPOFLUOROSA';ny[15]:='BROMICA';
ny[16]:='PERIODICA';
 end;
 
 procedure dati1;
 begin
 mx[1]:='FeO  2.3'; mx[2]:='Cu2O  1.2'; mx[3]:='Fe2O3  2.3'; 
 mx[4]:='CuO  1.2'; mx[5]:='PbO  2.4'; mx[6]:='SnO2  2.4'; 
 mx[7]:='Pb02  2.4'; mx[8]:='SnO  2.4'; mx[9]:='Au2O  1.3'; 
 mx[10]:='Au2O3  1.3';    
 
 my[1]:='FERROSO'; my[2]:='RAMEOSO';  my[3]:='FERRICO'; 
  my[4]:='RAMEICO';  my[5]:='PIOMBOSO';  my[6]:='STANNICO'; 
   my[7]:='PIOMBICO';  my[8]:='STANNOSO';  my[9]:='AUROSO'; 
    my[10]:='AURICO';        
end;
procedure pausa; 
begin
writeln('premi enter');readln;
end;
 
procedure cancella;
begin
clearscreen;
end;
procedure fine;  
begin
writeln('fine operazione:confermare :premi enter');
readln;
end;
procedure nome1;
begin
dati;writeln('scrivi nome del composto es. OSSIDO DI NOME3 ');
for a:=1 to k1 do
begin
writeln('---------------------------------------------');
write(fx[a],z);readln(ris);rip:=concat(sx,nx[a]);
if ris=rip then begin
writeln('esatto');esatte:=esatte+1;end
else writeln('errato:era:',rip);errate:=errate+1;end;
end;
procedure nome2;
begin
dati;writeln('scrivi la formula es.  Cl2O3   SO2  ');
for a:=1 to k1 do
begin
writeln('---------------------------------------------');
write(sx,nx[a],z);readln(ris);
if ris=fx[a] then begin
writeln('esatto');esatte:=esatte+1;end
else writeln('errato:era:',fx[a]);errate:=errate+1;end;
end;
procedure nome4;
begin
dati;writeln('scrivi nome del composto es. ANIDRIDE... ');
for a:=1 to k1 do
begin
writeln('---------------------------------------------');
write(fx[a],z);readln(ris);rip:=concat(sy,ny[a]);
if ris=rip then begin
writeln('esatto');esatte:=esatte+1;end
else writeln('errato:era:',rip);errate:=errate+1;end;
end;
procedure nome5;
begin
dati;writeln('scrivi la formula es.  Cl2O3   SO2  ');
for a:=1 to k1 do
begin
writeln('---------------------------------------------');
write(sy,ny[a],z);readln(ris);
if ris=fx[a] then begin
writeln('esatto');esatte:=esatte+1;end
else writeln('errato:era:',fx[a]);errate:=errate+1;end;
end;
procedure nome6;
begin
dati1;writeln('scrivi nome del composto es. OSSIDO OSO...ICO.. ');
writeln('si presenta formula e valenze possibili per metallo ');
writeln('esamina la valenza valida nel composto presentato ');
writeln('poi scrivi il suo nome ');
writeln;
for a:=1 to k2 do
begin
writeln('---------------------------------------------');
write(mx[a],z);readln(ris);rip:=concat(sm,my[a]);
if ris=rip then begin
writeln('esatto');esatte:=esatte+1;end
else writeln('errato:era:',rip);errate:=errate+1;end;
end;

procedure pro1;
begin
nome1;pausa;cancella;
end;
procedure pro2;
begin
nome2;pausa;cancella;
end;
procedure pro3;
begin
nome1;pausa;cancella;nome2;pausa;cancella;
end;
procedure pro4;
begin
nome4;pausa;cancella;
end;
procedure pro5;
begin
nome5;pausa;cancella;
end;
procedure pro6;
begin
nome6;pausa;cancella;
end;

procedure scelta;  
var s,sn:string;opzione:integer;
begin
cancella;;
writeln('seleziona opzione per NOMENCLATURA CHIMICA ANIDRIDI E ACIDI ');
writeln('1...data formula scrivi nome OSSIDO DI...');
writeln('2...dato nome scrivi formula');
writeln('3...riassume precedenti ');
writeln('4...data formula scrivi nome ANIDRIDE....');
writeln('5...dato nome scrivi formula ');
writeln('6...data formula scrivi il nome OSSIDO OSO...ICO ');
writeln('9...fine ');
writeln('scelta =');readln(opzione);cancella;
case opzione of
1:pro1;2:pro2;3:pro3;4:pro4;5:pro5;6:pro6;
9:fine;
end;
writeln('altra operazione?Esperimenti?:premi S...fine:premi N '); readln(sn);
if ((sn='S') or (sn='s')) then scelta ;
end;

begin            (* programma di lancio *)
cancella;
writeln('ATTENZIONE :scrivere le risposte in maiuscolo ');
writeln('senza spaziature prima e dopo la risposta ');
writeln('scrivere la valenza ');
writeln('es.  OSSIDO DI ZOLFO6    ANIDRIDE SOLFORICA   SO2  Cl2O3  ');
pausa;cancella;
sx:='OSSIDO DI ';z:='   ';sy:='ANIDRIDE ';sm:='OSSIDO ';
esatte:=0;errate:=0;totale:=0;
scelta;cancella;
writeln('risposte esatte  ',esatte,' su domande ',totale);
writeln('risposte errate  ',errate,' su domande ',totale);
writeln('chiama insegnante per valutazione ');pausa;
pausa;
end.