
09.07.2012, 12:17
|
 |
Новичок
|
|
Регистрация: 08.04.2012
Сообщения: 68
Версия Delphi: Delphi 7
Репутация: 127
|
|
Вот код:
Код:
var
Form1: TForm1;
a,b,c,i,rez:byte;
mas:array [1..8,1..8] of byte;
s1,s2:string;
implementation
{$R *.dfm}
function OutRez(rez:byte):byte;
var
x,y:byte;
begin
if i>2
then s1:=s1+IntToStr(rez)
else s2:=s2+IntToStr(rez);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
s1:=(''); s2:=('');
Label1.Caption:=('');
for i:=5 downto 0 do
begin
rez:=0;
randomize;
a:=random(2);
b:=random(2);
c:=random(2);
inc(rez,a);inc(rez,b);inc(rez,c);
if rez<2 then rez:=0
else rez:=1;
Label1.Caption:=Label1.Caption+(' ')+IntToStr(rez);
OutRez(rez);
end;
ShowMessage('s1 = '+s1+' s2 = '+s2 );
end;
end.
|