Ayuda con Pascal (Error 85)
Publicado por Eli (1 intervención) el 03/08/2006 22:19:24
Al final de todo en (end.) me aparece el siguiente error: error 85: " ; " expected y luego en el procedure "puntuacio" creo que me hace falta poner otro end pero no me deja ponerlo, quizas es por esto, espero q alguien pueda ayudarme porque estoy desesperada!! Gracias de antemano!
program sequencies_adn;
uses crt;
const
Esc=#27;
h=8;
s=9;
type
vector=array[1..h]of char;
matriu=array[1..s,1..s]of char;
matriu2=array[1..h,1..h]of integer;
var
comb_possibles,long_seq1,long_seq2,i,j:integer;
f:char;
Q,R:vector;
TC0:matriu;
DT1:matriu2;
function combinacions(x,y:integer):integer;
var
c,d,e:integer;
begin
if (x=0) and (y<>0) then
begin
combinacions:=1;
end else
if (y=0) and (x<>0) then
begin
combinacions:=1;
end else
if (x=0) and (y=0) then
begin
combinacions:=0;
end else
begin
c:=combinacions(x-1,y);
d:=combinacions(x-1,y-1);
e:=combinacions(x,y-1);
combinacions:=c+d+e;
end;
end;
procedure omplir_taula_vector(var L:vector);
begin
for i:=1 to 8 do
begin
L[i]:=' ';
end;
end;
procedure longitud_sequencies(var long:integer;var P:vector);
var
z:string;
begin
readln(z);
long:=length(z);
if long<=7 then
omplir_taula_vector(P);
begin
for i:=1 to (long+1) do
begin
P[i+1]:=z[i];
end;
P[1]:='_';
end;
end;
procedure comparar_longituds;
begin
writeln;
if (long_seq1>7) or (long_seq2>7) then
begin
if (long_seq1>7) and (long_seq2<=7) then
begin
writeln;
writeln('- La sequencia 1 te una longitud major a 7');
end else
if (long_seq2>7) and (long_seq1<=7) then
begin
writeln;
writeln('- La sequencia 2 te una longitud major a 7');
end;
end;
if (long_seq1>7) and (long_seq2>7) then
begin
writeln;
writeln('- Les dues sequencies tenen una longitud major a 7');
end;
end;
procedure omplir_taula_espais(var TCC:matriu);
begin
for i:=1 to 9 do
begin
for j:=1 to 9 do
begin
TCC[i,j]:=' ';
end;
end;
end;
procedure omplir_taula_zero(var T:matriu2);
begin
for i:=1 to 8 do
begin
for j:=1 to 8 do
begin
T[i,j]:=0;
end;
end;
end;
procedure omplir_matriu(var TC:matriu);
begin
omplir_taula_espais(TC);
i:=1;
for j:=2 to (long_seq1+1) do
begin
TC[i,j]:=Q[j-1];
end;
j:=1;
for i:=2 to (long_seq2+1) do
begin
TC[i,j]:=R[i-1];
end;
end;
procedure puntuacio(var TD1:matriu2);
begin
omplir_taula_zero(TD1);
j:=3;
while j<=9 do
begin
for i:=3 to (long_seq2+1) do
begin
if TC0[1,j]=TC0[i,1] then
begin
TD1[i-1,j-1]:=TD1[i-2,j-2]+1;
end else
TD1[i-1,j-1]:=TD1[i-2,j-2]-1;
end;
j:=j+1;
end;
end;
procedure puntuacio_global(var TD1:matriu2);
begin
j:=2;
TD1[1,1]:=0;
TD1[1,j]:=-2;
TD1[j,1]:=-2;
while j<=(long_seq1+1) do
begin
i:=1;
for j:=3 to (long_seq1+1) do
begin
TD1[i,j]:=TD1[i,j-1]-2;
end;
while i<=(long_seq2+1) do
begin
j:=1;
for i:=3 to (long_seq2+1) do
begin
TD1[i,j]:=TD1[i-1,j]-2;
end;
end;
puntuacio(TD1);
end;
BEGIN
clrscr;
begin
repeat
write('1- Entra la primera sequencia: ');
longitud_sequencies(long_seq1,Q);
writeln;
write('2- Entra la segona sequencia: ');
longitud_sequencies(long_seq2,R);
comparar_longituds;
if (long_seq1<=7) and (long_seq2<=7) then
begin
comb_possibles:=combinacions(long_seq1,long_seq2);
writeln;
writeln;
writeln('- El numero de combinacions possibles es: ',(comb_possibles));
omplir_matriu(TC0);
puntuacio_global(DT1);
end;
writeln;
textcolor(red);
writeln('Per continuar presioni "INTRO". Per sortir presioni "ESC"');
writeln('=========================================================');
textcolor(lightgray);
writeln;
writeln;
writeln;
f:=readkey;
until (f=Esc);
writeln;
end;
END. <------------------- AQUI ME DA EL ERROR
program sequencies_adn;
uses crt;
const
Esc=#27;
h=8;
s=9;
type
vector=array[1..h]of char;
matriu=array[1..s,1..s]of char;
matriu2=array[1..h,1..h]of integer;
var
comb_possibles,long_seq1,long_seq2,i,j:integer;
f:char;
Q,R:vector;
TC0:matriu;
DT1:matriu2;
function combinacions(x,y:integer):integer;
var
c,d,e:integer;
begin
if (x=0) and (y<>0) then
begin
combinacions:=1;
end else
if (y=0) and (x<>0) then
begin
combinacions:=1;
end else
if (x=0) and (y=0) then
begin
combinacions:=0;
end else
begin
c:=combinacions(x-1,y);
d:=combinacions(x-1,y-1);
e:=combinacions(x,y-1);
combinacions:=c+d+e;
end;
end;
procedure omplir_taula_vector(var L:vector);
begin
for i:=1 to 8 do
begin
L[i]:=' ';
end;
end;
procedure longitud_sequencies(var long:integer;var P:vector);
var
z:string;
begin
readln(z);
long:=length(z);
if long<=7 then
omplir_taula_vector(P);
begin
for i:=1 to (long+1) do
begin
P[i+1]:=z[i];
end;
P[1]:='_';
end;
end;
procedure comparar_longituds;
begin
writeln;
if (long_seq1>7) or (long_seq2>7) then
begin
if (long_seq1>7) and (long_seq2<=7) then
begin
writeln;
writeln('- La sequencia 1 te una longitud major a 7');
end else
if (long_seq2>7) and (long_seq1<=7) then
begin
writeln;
writeln('- La sequencia 2 te una longitud major a 7');
end;
end;
if (long_seq1>7) and (long_seq2>7) then
begin
writeln;
writeln('- Les dues sequencies tenen una longitud major a 7');
end;
end;
procedure omplir_taula_espais(var TCC:matriu);
begin
for i:=1 to 9 do
begin
for j:=1 to 9 do
begin
TCC[i,j]:=' ';
end;
end;
end;
procedure omplir_taula_zero(var T:matriu2);
begin
for i:=1 to 8 do
begin
for j:=1 to 8 do
begin
T[i,j]:=0;
end;
end;
end;
procedure omplir_matriu(var TC:matriu);
begin
omplir_taula_espais(TC);
i:=1;
for j:=2 to (long_seq1+1) do
begin
TC[i,j]:=Q[j-1];
end;
j:=1;
for i:=2 to (long_seq2+1) do
begin
TC[i,j]:=R[i-1];
end;
end;
procedure puntuacio(var TD1:matriu2);
begin
omplir_taula_zero(TD1);
j:=3;
while j<=9 do
begin
for i:=3 to (long_seq2+1) do
begin
if TC0[1,j]=TC0[i,1] then
begin
TD1[i-1,j-1]:=TD1[i-2,j-2]+1;
end else
TD1[i-1,j-1]:=TD1[i-2,j-2]-1;
end;
j:=j+1;
end;
end;
procedure puntuacio_global(var TD1:matriu2);
begin
j:=2;
TD1[1,1]:=0;
TD1[1,j]:=-2;
TD1[j,1]:=-2;
while j<=(long_seq1+1) do
begin
i:=1;
for j:=3 to (long_seq1+1) do
begin
TD1[i,j]:=TD1[i,j-1]-2;
end;
while i<=(long_seq2+1) do
begin
j:=1;
for i:=3 to (long_seq2+1) do
begin
TD1[i,j]:=TD1[i-1,j]-2;
end;
end;
puntuacio(TD1);
end;
BEGIN
clrscr;
begin
repeat
write('1- Entra la primera sequencia: ');
longitud_sequencies(long_seq1,Q);
writeln;
write('2- Entra la segona sequencia: ');
longitud_sequencies(long_seq2,R);
comparar_longituds;
if (long_seq1<=7) and (long_seq2<=7) then
begin
comb_possibles:=combinacions(long_seq1,long_seq2);
writeln;
writeln;
writeln('- El numero de combinacions possibles es: ',(comb_possibles));
omplir_matriu(TC0);
puntuacio_global(DT1);
end;
writeln;
textcolor(red);
writeln('Per continuar presioni "INTRO". Per sortir presioni "ESC"');
writeln('=========================================================');
textcolor(lightgray);
writeln;
writeln;
writeln;
f:=readkey;
until (f=Esc);
writeln;
end;
END. <------------------- AQUI ME DA EL ERROR
Valora esta pregunta


0