Einzelnen Beitrag anzeigen

Reloaded

Registriert seit: 25. Aug 2003
4 Beiträge
 
#6

Re: Hilfe bei nem Algorythmus

  Alt 26. Aug 2003, 11:01
Danke für die Hilfe, ich bastel dann mal weiter.

Nachtrag:So hab hier ne ganz leichte Lösung da das mit den Arrays bei mir nicht so geklappt hat, bissel umständlich aber egal :
Delphi-Quellcode:
begin
repeat
random;
Zahl1 := Random(48 )+1;
Label1.Caption := InttoStr(Zahl1);
Zahl2 := Random(48 )+1;
Label2.Caption := InttoStr(Zahl2);
Zahl3 := Random(48 )+1;
Label3.Caption := InttoStr(Zahl3);
Zahl4 := Random(48 )+1;
Label4.Caption := InttoStr(Zahl4);
Zahl5 := Random(48 )+1;
Label5.Caption := InttoStr(Zahl5);
Zahl6 := Random(48 )+1;
Label6.Caption := InttoStr(Zahl6);
Zahl7 := Random(48 )+1;
Label7.Caption := InttoStr(Zahl7);
Ungleichheit:=True;

//Zahl1
if Zahl1 = Zahl2
then Ungleichheit := False;
if Zahl1 = Zahl3
then Ungleichheit := False;
if Zahl1 = Zahl3
then Ungleichheit := False;
if Zahl1 = Zahl4
then Ungleichheit := False;
if Zahl1 = Zahl5
then Ungleichheit := False;
if Zahl1 = Zahl6
then Ungleichheit := False;
if Zahl1 = Zahl7
then Ungleichheit := False;

//Zahl2
if Zahl2 = Zahl3
then Ungleichheit := False;
if Zahl2 = Zahl4
then Ungleichheit := False;
if Zahl2 = Zahl5
then Ungleichheit := False;
if Zahl2 = Zahl6
then Ungleichheit := False;
if Zahl2 = Zahl7
then Ungleichheit := False;

//Zahl3
if Zahl3 = Zahl4
then Ungleichheit := False;
if Zahl3 = Zahl5
then Ungleichheit := False;
if Zahl3 = Zahl6
then Ungleichheit := False;
if Zahl3 = Zahl7
then Ungleichheit := False;

//Zahl4
if Zahl4 = Zahl5
then Ungleichheit := False;
if Zahl4 = Zahl6
then Ungleichheit := False;
if Zahl4 = Zahl7
then Ungleichheit := False;

//Zahl5
if Zahl5 = Zahl6
then Ungleichheit := False;
if Zahl5 = Zahl7
then Ungleichheit := False;

//Zahl6
if Zahl6 = Zahl7
then Ungleichheit := False;

until Ungleichheit;
end;
[edit=Luckie]Quote-Tags durch Delphi-Tags ersetzt. Mfg, Luckie[/edit]
  Mit Zitat antworten Zitat