unit u_boese_eins;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan, StdCtrls;
type
TForm1 =
class(TForm)
b_wuerfeln: TButton;
l_summe1: TLabel;
XPManifest1: TXPManifest;
Label1: TLabel;
l_gewuerfelte_zahl1: TLabel;
Label3: TLabel;
Label4: TLabel;
b_wuerfeln2: TButton;
l_summe2: TLabel;
Label6: TLabel;
l_gewuerfelte_zahl2: TLabel;
Label8: TLabel;
Label9: TLabel;
b_aufhoeren: TButton;
b_aufhoeren2: TButton;
procedure b_wuerfelnClick(Sender: TObject);
procedure b_aufhoerenClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
zahl1,zahl2,summe1,summe2,falls1:integer;
implementation
{$R *.dfm}
procedure TForm1.b_wuerfelnClick(Sender: TObject);
begin
zahl1:=random(6)+1;
l_gewuerfelte_zahl1.Caption:=IntToStr(zahl1);
If zahl1=1
Then begin
summe1:=0;
l_summe1.Caption:=IntToStr(summe1);
b_wuerfeln.enabled := false;
end else begin
summe1:=summe1+zahl1;
l_summe1.Caption:=IntToStr(summe1);
end;
end;
procedure TForm1.b_aufhoerenClick(Sender: TObject);
begin
b_wuerfeln.enabled := false;
end;
end.
procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
end;
end.