I receive an error
ejercicio.pas(10,9) Fatal: Syntax error, ":" expected but "(" found
in the following code
procedure darUnPaso(var x, y: integer; vx, vy: integer);
begin
x := x + vx;
y := y + vy;
end;
function estanChocando(x1, y1, x2, y2: integer): boolean;
(* precondition: ( sqr(x2-x1))+sqr(y2-y1)) mayor o igual a 0*)
var
true: boolean;
dist((x1, y1), (x2, y2)): real;
begin
true:= (dist((x1, y1), (x2, y2))) < RADIO + RADIO;
(dist((x1, y1);(x2, y2))):= sqrt((sqr(x2-x1))+(sqr(y2-y1)));
if true then
estanChocando:= true
end;
function esPosicionValida(x1, y1: integer): boolean;
var true:
boolean;
begin
true:=((RADIO<=x1<=ANCHO-RADIO) and
(RADIO<=y1<=ALTO-RADIO));
if true then
esPosicionValida:=true
end;
function predecirColision(x1,y1,vx1,vy1,x2,y2,vx2,vy2: integer): integer;
(*ninguna de las pelotas està detenida y ambas pelotas
estàn en posiciones vàlidas*)
var true: boolean;
begin
true := estanChocando(x1,y1,x2,y2) or ((esPosicionValida(x1,y1) and (esPosicionValida(x2,y2));
if true then
predecirColision:=darUnPaso
else
predecirColision:=-1
end;
I can't find the error in the code in
dist((x1, y1), (x2, y2)): real;