AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Frage zu Lottozahlengenerator

Ein Thema von Siggy · begonnen am 1. Mai 2009 · letzter Beitrag vom 2. Mai 2009
Antwort Antwort
Siggy

Registriert seit: 25. Okt 2008
20 Beiträge
 
#1

Re: Frage zu Lottozahlengenerator

  Alt 1. Mai 2009, 13:09
Ich hatte erst eine Lösung die auch funktioniert hat.
Die sah so aus:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d,e,f :integer;
begin
randomize;
repeat
  a:= random (49);
  b:= random (49);
  c:= random (49);
  d:= random (49);
  e:= random (49);
  f:= random (49);

until (a<>b) and (a<>c) and (a<>d) and (a<>e) and (a<>f)
and (b<>c) and (b<>d) and (b<>e) and (b<>f)
and (c<>d) and (c<>d) and (c<>f)
and (d<>e) and (d<>f)
and (e<>f);


edit1.Text := inttostr (a);
edit2.Text := inttostr (b);
edit3.Text := inttostr (c);
edit4.Text := inttostr (d);
edit5.Text := inttostr (e);
edit6.Text := inttostr (f);

Die auch funktioniert hat...
Allerdings ist die ja sehr unschön und ein ewig langer Text...
Unser Lehrer hat gemeint, dass wir das mit Arrays lösen sollen, allerdings hab ich davon keine Ahnung und daher hab ich hier gefragt ob mir das jemand anhand meines Lottogenerators erklären könnte.


Siggy
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:13 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz