unit unit_spiel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TFormSpiel =
class(TForm)
ImageWEins: TImage;
ImageWZwei: TImage;
ImageWDrei: TImage;
ImageWVier: TImage;
ImageWFuenf: TImage;
ButtonWuerfel: TButton;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure ButtonWuerfelClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
const
Bild1 = '
eins.bmp';
Bild2 = '
zwei.bmp';
Bild3 = '
drei.bmp';
Bild4 = '
vier.bmp';
Bild5 = '
fuenf.bmp';
Bild6 = '
sechs.bmp';
var
FormSpiel: TFormSpiel;
w:
array[1..5]
of integer;
i, j, k, l, m: integer;
implementation
{$R *.dfm}
procedure TFormSpiel.FormCreate(Sender: TObject);
begin
randomize;
end;
procedure TFormSpiel.ButtonWuerfelClick(Sender: TObject);
begin
w[1] := random(5) + 1;
w[2] := random(5) + 1;
w[3] := random(5) + 1;
w[4] := random(5) + 1;
w[5] := random(5) + 1;
//Bilder zuweisen ANFANG
case w[1]
of
1: ImageWEins.Picture.LoadFromFile(Bild1);
2: ImageWEins.Picture.LoadFromFile(Bild2);
3: ImageWEins.Picture.LoadFromFile(Bild3);
4: ImageWEins.Picture.LoadFromFile(Bild4);
5: ImageWEins.Picture.LoadFromFile(Bild5);
6: ImageWEins.Picture.LoadFromFile(Bild6);
end;
case W[2]
of
1: ImageWZwei.Picture.LoadFromFile(Bild1);
2: ImageWZwei.Picture.LoadFromFile(Bild2);
3: ImageWZwei.Picture.LoadFromFile(Bild3);
4: ImageWZwei.Picture.LoadFromFile(Bild4);
5: ImageWZwei.Picture.LoadFromFile(Bild5);
6: ImageWZwei.Picture.LoadFromFile(Bild6);
end;
case W[3]
of
1: ImageWDrei.Picture.LoadFromFile(Bild1);
2: ImageWDrei.Picture.LoadFromFile(Bild2);
3: ImageWDrei.Picture.LoadFromFile(Bild3);
4: ImageWDrei.Picture.LoadFromFile(Bild4);
5: ImageWDrei.Picture.LoadFromFile(Bild5);
6: ImageWDrei.Picture.LoadFromFile(Bild6);
end;
case W[4]
of
1: ImageWFuenf.Picture.LoadFromFile(Bild1);
2: ImageWFuenf.Picture.LoadFromFile(Bild2);
3: ImageWFuenf.Picture.LoadFromFile(Bild3);
4: ImageWFuenf.Picture.LoadFromFile(Bild4);
5: ImageWFuenf.Picture.LoadFromFile(Bild5);
6: ImageWFuenf.Picture.LoadFromFile(Bild6);
end;
case W[5]
of
1: ImageWVier.Picture.LoadFromFile(Bild1);
2: ImageWVier.Picture.LoadFromFile(Bild2);
3: ImageWVier.Picture.LoadFromFile(Bild3);
4: ImageWVier.Picture.LoadFromFile(Bild4);
5: ImageWVier.Picture.LoadFromFile(Bild5);
6: ImageWVier.Picture.LoadFromFile(Bild6);
end;
//Bilder zuweisen ENDE
end;
end.