Autor Beitrag
zero_cool1986
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 95

MS DOS ;)
D6
BeitragVerfasst: Mo 22.08.05 15:39 
hi.

also ich poste mal den code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Timer2Timer(Sender: TObject);
var i:integer;
begin
for i:=0 to 4 do begin
[i]:=random ;
end;
end;

der funktioniert nich. der soll zufallszahlen von zwischen 1 und 4 machen wobei die 1 und die 4 auch möglich ist.

wer kann helfen?

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconTino: Drei Sätze aus dem ganzen hier gemacht.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 22.08.05 15:50 
Wenn ich den Code richtig deute, möchtesdt du 5 Zufällige Ganzzahlen jeweils zwischen 1 und 4?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
x: integer;
z: array[0..4] of integer;
begin
randomize;
for x := 0 to 4 do
  begin
  z[x] := random(4)+1;
  end;
end;