unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Buttons;
type
{ TForm1 }
TForm1 =
class(TForm)
btngo: TButton;
Button1: TButton;
Image1: TImage;
Shape1: TShape;
Shape10: TShape;
Shape11: TShape;
Shape12: TShape;
Shape13: TShape;
Shape14: TShape;
Shape15: TShape;
Shape16: TShape;
Shape17: TShape;
Shape18: TShape;
Shape19: TShape;
Shape2: TShape;
Shape20: TShape;
Shape21: TShape;
Shape22: TShape;
Shape23: TShape;
Shape24: TShape;
Shape25: TShape;
Shape26: TShape;
Shape27: TShape;
Shape28: TShape;
Shape29: TShape;
Shape3: TShape;
Shape30: TShape;
Shape31: TShape;
Shape32: TShape;
Shape33: TShape;
Shape34: TShape;
Shape35: TShape;
Shape36: TShape;
Shape37: TShape;
Shape38: TShape;
Shape39: TShape;
Shape4: TShape;
Shape40: TShape;
Shape41: TShape;
Shape42: TShape;
Shape43: TShape;
Shape44: TShape;
Shape45: TShape;
Shape46: TShape;
Shape47: TShape;
Shape48: TShape;
Shape49: TShape;
Shape5: TShape;
Shape50: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
Shape9: TShape;
procedure btngoClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Image1Click(Sender: TObject);
procedure Timer1StartTimer(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
inils,iemmi,iphillip,ipauline,imichi,z1,z2,z3,z4,i:integer;
shape:
array [1..50]
of tshape;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Image1Click(Sender: TObject);
begin
end;
procedure TForm1.Timer1StartTimer(Sender: TObject);
begin
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
inils:=0;
iemmi:=0;
iphillip:=0;
ipauline:=0;
imichi:=0;
end;
procedure TForm1.btngoClick(Sender: TObject);
begin
//Zufallsgen
randomize;
z1:=random(2);
z2:=random(2);
z3:=random(2);
z4:=random(2);
//Implementation
If z1 =0
then if z2=0
then if z3=0
then if z4=0
then inils:=inils+1
else iemmi:=iemmi+1
else if z4=0
then iemmi:=iemmi+1
else iphillip:=iphillip+1
else if z3=0
then if z4=0
then iemmi:=iemmi+1
else iphillip:=iphillip+1
else if z4=0
then iphillip:=iphillip+1
else ipauline:=ipauline+1
else if z2=0
then if z3=0
then if z4=0
then iemmi:=iemmi+1
else iphillip:=iphillip+1
else if z4=0
then iphillip:=iphillip+1
else ipauline:=ipauline+1
else if z3=0
then if z4=0
then iphillip:=iphillip+1
else ipauline:=ipauline+1
else if z4=0
then ipauline:=ipauline+1
else imichi:=imichi+1;
//button deaktivieren
if imichi+ipauline+iemmi+iphillip+inils=10
then btngo.enabled:= false;
//Kugel sichtbarkeit
case inils
of
1: shape1.visible:=true;
2: shape2.visible:=true;
3: shape3.visible:=true;
4: shape4.visible:=true;
5: shape5.visible:=true;
6: shape6.visible:=true;
7: shape7.visible:=true;
8: shape8.visible:=true;
9: shape9.visible:=true;
10: shape10.visible:=true;
end;
case iemmi
of
1: shape11.visible:=true;
2: shape12.visible:=true;
3: shape13.visible:=true;
4: shape14.visible:=true;
5: shape15.visible:=true;
6: shape16.visible:=true;
7: shape17.visible:=true;
8: shape18.visible:=true;
9: shape19.visible:=true;
10: shape20.visible:=true;
end;
case iphillip
of
1: shape21.visible:=true;
2: shape22.visible:=true;
3: shape23.visible:=true;
4: shape24.visible:=true;
5: shape25.visible:=true;
6: shape26.visible:=true;
7: shape27.visible:=true;
8: shape28.visible:=true;
9: shape29.visible:=true;
10: shape30.visible:=true;
end;
case ipauline
of
1: shape31.visible:=true;
2: shape32.visible:=true;
3: shape33.visible:=true;
4: shape34.visible:=true;
5: shape35.visible:=true;
6: shape36.visible:=true;
7: shape37.visible:=true;
8: shape38.visible:=true;
9: shape39.visible:=true;
10: shape40.visible:=true;
end;
case imichi
of
1: shape41.visible:=true;
2: shape42.visible:=true;
3: shape43.visible:=true;
4: shape44.visible:=true;
5: shape45.visible:=true;
6: shape46.visible:=true;
7: shape47.visible:=true;
8: shape48.visible:=true;
9: shape49.visible:=true;
10: shape50.visible:=true;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
inils:=0;
iemmi:=0;
iphillip:=0;
ipauline:=0;
imichi:=0;
btngo.enabled:=true;
for i:=1
to 50
do
begin
shape[i].visible:=false;
end;
end ;
end.