Autor Beitrag
bfelix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 61

WIN 2000 Prof., Win XP Prof., Win 7 Starter und Prof., SuSe Linux 11.3,
Delphi 7 Pers.
BeitragVerfasst: Mi 16.02.11 21:24 
Hallo Community,
ich brauche für ein Programm einen Zufallsgenerator. Diesen habe ich ja mit
ausblenden Delphi-Quelltext
1:
random(maxzahl)					

schon in delphi integriert. Allerdings gibt er bei mir immer am Anfang zweimal 0 aus, was für mein Programm nicht gerade nützlich ist. Also meine Frage:
Gibt es eine Alternative zu random(), oder mach ich irgentwas falsch?

Danke,
BFelix
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19341
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 16.02.11 21:27 
Ich vermute du hast vergessen den Zufallsgenerator beim Start des Programms mit Randomize zu initialisieren. ;-)

Für diesen Beitrag haben gedankt: bfelix
bfelix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 61

WIN 2000 Prof., Win XP Prof., Win 7 Starter und Prof., SuSe Linux 11.3,
Delphi 7 Pers.
BeitragVerfasst: Mi 16.02.11 21:29 
muss man das bei delphi auch?
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Mi 16.02.11 21:31 
Ja, es empfiehlt sich dies zu tun. ;)

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.

Für diesen Beitrag haben gedankt: bfelix
bfelix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 61

WIN 2000 Prof., Win XP Prof., Win 7 Starter und Prof., SuSe Linux 11.3,
Delphi 7 Pers.
BeitragVerfasst: Mi 16.02.11 21:34 
OK danke frage wohl gelöst