Autor Beitrag
gerd99
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Fr 01.05.20 20:29 
Hallo,

ich suche das passende Wort für dieses Ergebnis:

000
100
010
001
110
101
011
111

Das Beispiel zeigt alle Moeglichkeiten mit 0 und 1 in einer 3-Kette. (Ich will das in einer 7-Kette programieren.
Wie heisst das Fachwort nachdem ich suchen muss. Ich will es nicht rekursiv haben.

Gerd

Moderiert von user profile iconNarses: Beiträge zusammengefasst

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
for a:=0 to 1 do begin
  zahl[1]:=a;
    for b:=0 to 1 do begin
      zahl[2]:=b;
      for c:=0 to 1 do begin
        zahl[3]:=c;
        memo1.Lines.add(inttostr(zahl[1])+' '+inttostr(zahl[2])+' '+
        inttostr(zahl[3]));
      end;
    end;
  end;


es ist gar nicht so schwer wie ich dachte.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8535
Erhaltene Danke: 473

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 01.05.20 23:37 
Muss es denn diese Reihenfolge sein? Oder ginge auch diese?

000
001
010
011
100
101
110
111

Denn das wäre einfach "Zählen von 0-7" in der Binärdarstellung. In einer "7er Kette" wäre das von 0 bis 2^8-1, also 0-255.

_________________
We are, we were and will not be.