1.
uses Robot;
begin
Task('if2');
paint;
right;
if wallfromright then
left;
end
else left;
if wallfromleft then
else right;
down;
if wallfromdown then
up;
else up;
if wallfromup then
else down;
end.
2.
Task('if3');
if wallfromdown and wallfromleft then
else if wallfromleft and wallfromup then
else if wallfromdown and wallfromright then
else if wallfromright and wallfromup then
end;
3.
Task('if4');
else if wallfromleft then
else if wallfromup then
else if wallfromdown then
1.
uses Robot;
begin
Task('if2');
paint;
right;
if wallfromright then
begin
paint;
left;
end
else left;
left;
if wallfromleft then
begin
paint;
right;
end
else right;
down;
if wallfromdown then
begin
paint;
up;
end
else up;
up;
if wallfromup then
begin
paint;
down;
end
else down;
end.
2.
uses Robot;
begin
Task('if3');
if wallfromdown and wallfromleft then
begin
up;
right;
paint;
end
else if wallfromleft and wallfromup then
begin
down;
right;
paint;
end
else if wallfromdown and wallfromright then
begin
up;
left;
paint;
end
else if wallfromright and wallfromup then
begin
down;
left;
paint;
end;
end.
3.
uses Robot;
begin
Task('if4');
if wallfromright then
begin
left;
paint;
end
else if wallfromleft then
begin
right;
paint;
end
else if wallfromup then
begin
down;
paint;
end
else if wallfromdown then
begin
up;
paint;
end
end.