Einzelnen Beitrag anzeigen

wurzelzwerg

Registriert seit: 19. Jun 2011
Ort: Ilmenau
111 Beiträge
 
Delphi XE5 Enterprise
 
#21

AW: Lotto Systemspiele berechnen

  Alt 22. Sep 2011, 19:58
Danke MrSpock, schau ich mir an.
Was hälst du davon?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
type
  TSpiel = record
    z1, z2, z3, z4, z5, z6: integer;
  end;
var
  i, k, l, m, n, o, p, max: integer;
  tipps: array of TSpiel;
  tipp: array[1..16] of integer;
begin
  for i:= 1 to 16 do
    tipp[i]:= i; // bzw. individueller Tipp
  max := 16;
  i := 1;
  for k := 1 to max - 5 do
    for l := k + 1 to max - 4 do
      for m := l + 1 to max - 3 do
        for n := m + 1 to max - 2 do
          for o := n + 1 to max - 1 do
            for p := o + 1 to max do
            begin
              SetLength(tipps, i);
              tipps[i - 1].z1 := tipp[k];
              tipps[i - 1].z2 := tipp[l];
              tipps[i - 1].z3 := tipp[m];
              tipps[i - 1].z4 := tipp[n];
              tipps[i - 1].z5 := tipp[o];
              tipps[i - 1].z6 := tipp[p];
              inc(i);
            end;

  Memo1.Lines.Clear;
  Memo1.Lines.BeginUpdate;
  for i := Low(tipps) to high(tipps) do
  begin
    Memo1.Lines.Add(IntToStr(tipps[i].z1) + ' ' +
      IntToStr(tipps[i].z2) + ' ' +
      IntToStr(tipps[i].z3) + ' ' +
      IntToStr(tipps[i].z4) + ' ' +
      IntToStr(tipps[i].z5) + ' ' +
      IntToStr(tipps[i].z6));
  end;
  Memo1.Lines.EndUpdate;
  Caption := IntToStr(Memo1.Lines.Count) + ' Tippreihen';
end;
Nun bleibt noch das VEW.
Sind das von Lotto festgelegte Kombinationen die man sich definieren muss?

Geändert von wurzelzwerg (22. Sep 2011 um 20:13 Uhr)
  Mit Zitat antworten Zitat