<h2><u>if8 </u></h2>
program raf105;
uses robot;
var l,d,r,u: boolean;
begin
task('if8');
l:= wallfromleft;
d:= wallfromdown;
r:= wallfromright;
u:= wallfromup;
if l
then begin right; paint; right; paint;
if freefromright
then begin right; paint; end
end;
if d
then begin up; paint; up; paint;
if freefromup
then begin up; paint; end
end;
if r
then begin left; paint; left; paint;
if freefromleft
then begin left; paint; end
end;
if u
then begin down; paint; down; paint;
if freefromdown
then begin down; paint; end
end;
end.
<h2><u>if9 </u></h2>
program raf105;
uses robot;
var l,r: boolean;
begin
task('if9');
right; r:= wallfromdown;
left;
left; l:= wallfromup;
right;
if r and l
then begin up; paint; down; down; paint; up; end
else paint;
end.
<h2><u>if10 </u></h2>
program raf105;
uses robot;
var l,r: boolean;
begin
task('if10');
right; r:= cellispainted;
left;
left; l:= cellispainted;
right;
if r or l
then begin up; paint; end
else paint;
end.