DELITELNOST procedure TForm1.Button1Click(Sender: TObject); var pocet,i:integer; begin Image1.Canvas.Fillrect(ClientRect); pocet:=0; For i:=1 to StrToInt (Edit1.Text) do Begin If (i mod 10=0) or (i mod 5=0) then pocet:=pocet +1; end; Image1.Canvas.TextOut(50,50,'Počet čísel, ktoré sú delieľné 10 a 5 je ' +IntToStr(pocet)+'.'); end;
DELITEL procedure TForm1.Button1Click(Sender: TObject); var cislo:integer; delitel:integer; begin Image1.Canvas.FillRect(ClientRect); cislo:=StrToInt(Edit1.Text); If (cislo mod 2=0) then Image1.canvas.TextOut(20,50,'Číslo' +IntToStr(cislo)+'je deliteľné číslom.'+ IntToStr(delitel)+'.') else Image1.canvas.TextOut(20,50,'Číslo' +IntToStr(cislo)+'nie je deliteľné číslom.'+ IntToStr(delitel)+'.')
TROJUHOLNIKY OD HORA DOLE procedure TForm1.Button2Click(Sender: TObject); var i:integer; begin Image1.Canvas.Brush.Color:=clwhite; Image1.Canvas.FillRect(ClientRect); For i:= 1 to 10 do begin Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256)); Image1.Canvas.Polygon([point(200,50+30*i),point(220,50+30*i),point(220,30+30*i)]); end; end;
ŠTVORCE OD HORA DOLE procedure TForm1.Button4Click(Sender: TObject); var i:integer; begin Image1.Canvas.Brush.Color:=clwhite; Image1.Canvas.FillRect(ClientRect); i:=20; For i:= 1 to 50 do Begin Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256)); Image1.Canvas.Rectangle(200,20*i,200+10,20*i+10); end; end;
TRJOUHOLNIKY OD PRAVA DO LAVA procedure TForm1.Button3Click(Sender: TObject); var i,x,y:integer; begin Image1.Canvas.Brush.Color:=clwhite; Image1.Canvas.FillRect(ClientRect); x:=100; y:=200; For i:= 1 to 50 do begin Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256)); Image1.Canvas.Polygon([point(x,y),point(x+30,y),point(x+30,y-30)]); x:=x+60 end; end;
Ďakujem :)
Kluci, jste dobří!!
DELITELNOST
procedure TForm1.Button1Click(Sender: TObject);
var
pocet,i:integer;
begin
Image1.Canvas.Fillrect(ClientRect);
pocet:=0;
For i:=1 to StrToInt (Edit1.Text) do
Begin
If (i mod 10=0) or (i mod 5=0) then
pocet:=pocet +1;
end;
Image1.Canvas.TextOut(50,50,'Počet čísel, ktoré sú delieľné 10 a 5 je ' +IntToStr(pocet)+'.');
end;
4:40
Malé zariadenie čiže microcontroller
Napríklad:Raspberry pi pico
DOM A ZAHRADA
procedure TForm1.Button1Click(Sender: TObject);
begin
Image1.Canvas.Brush.Color:=clwhite;
Image1.Canvas.FillRect(ClientRect);
Image1.Canvas.Brush.Color:=clgreen;
Image1.Canvas.Rectangle(0,230,400,400);
Image1.Canvas.Brush.Color:=clred;
Image1.Canvas.Rectangle(30,180,180,290);
Image1.Canvas.Brush.Color:=clyellow;
Image1.Canvas.Ellipse(250,50,360,120);
end;
DELITEL
procedure TForm1.Button1Click(Sender: TObject);
var
cislo:integer;
delitel:integer;
begin
Image1.Canvas.FillRect(ClientRect);
cislo:=StrToInt(Edit1.Text);
If (cislo mod 2=0) then
Image1.canvas.TextOut(20,50,'Číslo' +IntToStr(cislo)+'je deliteľné číslom.'+ IntToStr(delitel)+'.')
else
Image1.canvas.TextOut(20,50,'Číslo' +IntToStr(cislo)+'nie je deliteľné číslom.'+ IntToStr(delitel)+'.')
TROJUHOLNIKY OD HORA DOLE
procedure TForm1.Button2Click(Sender: TObject);
var
i:integer;
begin
Image1.Canvas.Brush.Color:=clwhite;
Image1.Canvas.FillRect(ClientRect);
For i:= 1 to 10 do
begin
Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256));
Image1.Canvas.Polygon([point(200,50+30*i),point(220,50+30*i),point(220,30+30*i)]);
end;
end;
ŠTVORCE OD HORA DOLE
procedure TForm1.Button4Click(Sender: TObject);
var
i:integer;
begin
Image1.Canvas.Brush.Color:=clwhite;
Image1.Canvas.FillRect(ClientRect);
i:=20;
For i:= 1 to 50 do
Begin
Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256));
Image1.Canvas.Rectangle(200,20*i,200+10,20*i+10);
end;
end;
TRJOUHOLNIKY OD PRAVA DO LAVA
procedure TForm1.Button3Click(Sender: TObject);
var
i,x,y:integer;
begin
Image1.Canvas.Brush.Color:=clwhite;
Image1.Canvas.FillRect(ClientRect);
x:=100;
y:=200;
For i:= 1 to 50 do
begin
Image1.Canvas.Brush.Color:=RGBToColor(random(256),random(256),random(256));
Image1.Canvas.Polygon([point(x,y),point(x+30,y),point(x+30,y-30)]);
x:=x+60
end;
end;