{Vyplnanie 4-smerne, R.Novotny}

program sema;
  uses grafika;
  var color:byte;

  procedure maluj(x,y:integer; farba:byte; farbahranice:byte);
  begin
    if(x>=0) and (y>=0) and (x<320) and (y<200) then begin
      if (farbabodu_pc(x,y)<>farbahranice) and (farbabodu_pc(x,y)<>farba) then begin
        bod_pc(x,y,farba);
        maluj(x-1, y, farba, farbahranice);
        maluj(x, y-1, farba, farbahranice);
        maluj(x, y+1, farba, farbahranice);
        maluj(x+1, y, farba, farbahranice);
      end;
    end;
  end; {maluj}
begin

  init($13);
  usecka_b(10, 10, 20, 14, 14);
  usecka_b(20, 14, 30, 10, 14);
  usecka_b(30, 10, 30, 30, 14);
  usecka_b(30, 30, 10, 30, 14);
  usecka_b(10, 30, 10, 10, 14);

  {bod_pc(20, 20, 13);}
  maluj(20, 20, 13, 14);
  readln;
end.