SCAR Code:
program CrazyTaxi;
const
RoadColor=11119017;
var
x,y,f,b,l,m,r:integer;
procedure DodgeCars;
begin
b:=500
l:=645
r:=m*2-l
m:=707
f:=2
SendArrowWait(0,2200);
repeat
if not(FindColor(x,y,RoadColor,l,b,l,b)) and not(FindColor(x,y,RoadColor,m,b,m,b)) and(FindColor(x,y,RoadColor,r,b,r,b)) then
begin
if(f=2) then
begin
SendArrow(1);
f:=f+1
WriteLn('Now in file 3');
end else
if(f=1) then
begin
SendArrow(1);
Wait(150);
SendArrow(1);
f:=f+2
WriteLn('Now in file 3');
end;
end else
if(FindColor(x,y,RoadColor,l,b,l,b)) and not(FindColor(x,y,RoadColor,m,b,m,b)) and not(FindColor(x,y,RoadColor,r,b,r,b)) then
begin
if(f=2) then
begin
SendArrow(3);
f:=f-1
WriteLn('Now in file 1');
end else
if(f=3) then
begin
SendArrow(3);
Wait(150);
SendArrow(3);
f:=f-2
WriteLn('Now in file 1');
end;
end else
if not(FindColor(x,y,RoadColor,l,b,l,b)) and(FindColor(x,y,RoadColor,m,b,m,b)) and not(FindColor(x,y,RoadColor,r,b,r,b)) then
begin
if(f=1) then
begin
SendArrow(1);
f:=f+1
WriteLn('Now in file 2');
end else
if(f=3) then
begin
SendArrow(3);
f:=f-1
WriteLn('Now in file 2');
end;
end else
if not(FindColor(x,y,RoadColor,l,b,l,b)) and(FindColor(x,y,RoadColor,m,b,m,b)) and(FindColor(x,y,RoadColor,r,b,r,b)) then
begin
if(f=1) then
begin
SendArrow(1);
f:=f+1
WriteLn('Now in file 2');
end;
end;
until(false);
end;
begin
ClearDebug;
DodgeCars;
end.