Pyramina + zelene gulicky a zlte kocky

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var x,y,v,d,a,i,j,n,POM,z:integer; begin Z:=strtoint(edit1.text); x:=400; y:=100; v:=30; d:=60; n:=z; a:=round(d/2); for i:=1 to z do begin x:=x-a; POM:=x; y:=y+v; for j:=1 to i do begin canvas.brush.color:=random(256*256*256); canvas.Rectangle(x,y,x+d,y+v); x:=x+d; end; x:=POM; end; end; procedure TForm1.Button2Click(Sender: TObject); var x,x1,y1,y,n,a,j,c,i:integer; begin x:=100; y1:=200; a:=20; n:=10; for i:=1 to n do begin x1:=x; y1:=y1+25; for j:=1 to i do begin canvas.brush.color:=clyellow; canvas.rectangle(x1,y1,x1+a,y1+a); x1:=x1+25; end; for c:=n downto i do begin canvas.brush.color:=clgreen; canvas.ellipse(x1,y1,x1+a,y1+a); x1:=x1+25; end; end; end; end.