Исходники и листинги ::: Delphi ::: Слабое звено

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  unit Unit1;
 
  interface
 
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls;
 
  type
    TForm1 = class(TForm)
      Image1: TImage;
      Image2: TImage;
      Image3: TImage;
      Image4: TImage;
      Image5: TImage;
      Image6: TImage;
      Image7: TImage;
      Image8: TImage;
      BitBtn1: TBitBtn;
      Label1: TLabel;
      procedure BitBtn1Click(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
 
  var
    Form1: TForm1;
    g,m: array[1..4] of integer;
    i,s,s2,kg,km,j: integer;
 
  implementation
 
  {$R *.dfm}
 
  procedure TForm1.BitBtn1Click(Sender: TObject);
  begin
   randomize;
    j:=j+1;
   
   // женщины
  repeat
  s:=0;
   kg:=random(4)+1;
   for i:= 1 to j do if g[i]= kg then s:=1;
  until s=0;
 
     case kg of
     1: image1.Visible:=false;
     2: image2.Visible:=false;
     3: image3.Visible:=false;
     4: image4.Visible:=false;
     end;
   g[j]:=kg;
 
   // мужики
 
  repeat
   s2:=0;
   km:=random(4)+1;
   for i:= 1 to j do if m[i]= km then s2:=1;
  until s2=0;
 
     case km of
     1: image5.Visible:=false;
     2: image6.Visible:=false;
     3: image7.Visible:=false;
     4: image8.Visible:=false;
     end;
   m[j]:=km;
  if j=3
  then
  begin
  bitbtn1.Enabled:=false;
  label1.Caption:='Идеальная пара!'
  end
  end;
 
  end.
<<< Предыдущая работа

Вернуться в галерею исходников
Слабое звено
Автор: Taow*
Город: Дульдурга
Дата: 20.11.2006  19:05
Комментариев: 1
Просмотров: 191
Оценка: 0 (0|0|0|0|0) [0]

Вернуться на главную
Авторский комментарий к работе: Убираются пары фотографий случайным образом в итоге остаётся случайная "идеальная пара"
Вы не можете оценивать

КОММЕНТАРИИ К РАБОТЕ:
delphIN* ::: комментарий от 18.02.2007 | 19:45
delphIN Перспективный (ур.8)
Очки: 1552
Город: Братск
Тв. работ: 10
Рег: 17.01.2007 (2628)
Прикольно!!!