unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, Math, StdCtrls, Buttons; type TForm1 = class(TForm) Shape1: TShape; StaticText1: TStaticText; BitBtn1: TBitBtn; BitBtn2: TBitBtn; BitBtn3: TBitBtn; procedure FormCreate(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; sitze: array[1..8] of TShape; zwerg: array[1..8] of String; l: array[1..8] of Integer = (50, 65, 80, 65, 50, 35, 20, 35); h: array[1..8] of Integer = (10, 25, 40, 55, 70, 55, 40, 25); farben: array[1..8] of TColor = (clBlack, clPurple, clRed, clGreen, clYellow, clBlue, clAqua, clWhite); implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var i: byte; begin for i:=1 to 8 do begin zwerg[i]:= 'z' + IntToStr(i); end; for i:=1 to 8 do begin sitze[i]:=TShape.Create(self); with sitze[i] do begin Parent:=Form1; Shape:=stCircle; width:=30; //r Left:=l[i]*5; Top:=h[i]*5; Tag:=i; Brush.Color:=farben[i]; Show; end; end; end; procedure TForm1.BitBtn1Click(Sender: TObject); var help: TColor; i: byte; begin help:= farben[8]; for i:=8 downto 2 do begin farben[i]:=farben[i-1]; end; farben[1]:=help; for i:=1 to 8 do begin sitze[i]:=TShape.Create(self); with sitze[i] do begin Parent:=Form1; Shape:=stCircle; width:=30; //r Left:=l[i]*5; Top:=h[i]*5; Tag:=i; Brush.Color:=farben[i]; Show; end; end; end; procedure TForm1.BitBtn2Click(Sender: TObject); var help: TColor; i: byte; begin help:= farben[1]; for i:=1 to 7 do begin farben[i]:=farben[i+1]; end; farben[8]:=help; for i:=1 to 8 do begin sitze[i]:=TShape.Create(self); with sitze[i] do begin Parent:=Form1; Shape:=stCircle; width:=30; //r Left:=l[i]*5; Top:=h[i]*5; Tag:=i; Brush.Color:=farben[i]; Show; end; end; end; end.