ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1033. Labyrinth

why I get Compilation Error
Posted by liuzhizhi 13 Jul 2004 08:40
var
 a:array[0..35,0..35]of integer;
 n:integer;
 total:longint;
procedure init;
 var
  i,j:integer;
  t:char;
 begin
  readln(n);
  for i:=0 to n+1 do
    for j:=0 to n+1 do a[i,j]:=1;
  for i:=1 to n do
   begin
    for j:=1 to n do
      begin
       read(t);
       if t='#' then a[i,j]:=1;
       if t='.' then a[i,j]:=0;
    end;
   readln;
  end;
 end;

procedure try(i,j:integer);
 var
  x:integer;
 begin
  a[i,j]:=2;
  if a[i+1,j]=1 then total:=total+9;
  if a[i-1,j]=1 then total:=total+9;
  if a[i,j+1]=1 then total:=total+9;
  if a[i,j-1]=1 then total:=total+9;
  for x:=1 to 4 do
   begin
    if (x=1)and(a[i+1,j]=0) then try(i+1,j);
    if (x=2)and(a[i-1,j]=0) then try(i-1,j);
    if (x=3)and(a[i,j+1]=0) then try(i,j+1);
    if (x=4)and(a[i,j-1]=0) then try(i,j-1);
   end;
 end;

begin
 init;
 total:=0;
 try(1,1);
 write(total-36);
end.
'Try' is a reserved word. Just rename your procedure (-)
Posted by Dmitry 'Diman_YES' Kovalioff 13 Jul 2004 12:09
Re: 'Try' is a reserved word. Just rename your procedure (-)
Posted by liuzhizhi 14 Jul 2004 13:40
thanks very much