Помогите, пожалуйста! Нужно в поограмме pascal abc (uses robot) решить задание if5, if6, if7. До завтра нужно на контрольную, я совсем не понимаю, как это решать. Помогите, пожалуйста

Есть ответ
12.12.2022
318

Ответ


if5                                              program raf105;

uses robot;

begin

task('if5');

if (wallfromdown) or (wallfromup)

 then begin left; paint; right; right; paint; left;

 end;

if (wallfromleft) or (wallfromright)

 then begin up; paint; down; down; paint; up;

 end;

end.

if6                                              program raf105;

uses robot;

begin

task('if6');

up;

if cellispainted

 then begin down; down; paint; end

 else begin down; down;

   if cellispainted

     then begin up; up; paint; end

     else begin up; left;

       if cellispainted

         then begin right; right; paint; end

         else paint;

     end;

 end;

end.

if7                                              program raf105;

uses robot;

begin

task('if7');

if wallfromright and wallfromdown

 then begin up; left; paint; end;

if wallfromleft and wallfromdown

 then begin up; right; paint; end;

if wallfromup and wallfromleft

 then begin right; down; paint; end;

if wallfromup and wallfromright

 then begin down; left; paint; end

end.


Если вы нашли правильное решение, вы можете поблагодарить нас начиная с 10 рублей.
Просто нажмите на кнопку "Подарить".
12.12.2022
Этот сайт использует cookies (Политика Cookies). Вы можете указать условия хранения и доступ к cookies в своем браузере.