AGB  ·  Datenschutz  ·  Impressum  







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

Lotto programm

Ein Thema von ScrollbarKopf · begonnen am 18. Dez 2007 · letzter Beitrag vom 18. Dez 2007
 
ScrollbarKopf

Registriert seit: 17. Okt 2007
154 Beiträge
 
#1

Lotto programm

  Alt 18. Dez 2007, 14:41
Hallo Leute habe jetzt ein Programm das mir aus 45 zahlen 6 zufällige nimmt.
Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

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

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

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

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
edit1.clear;
edit2.clear;
edit3.clear;
edit4.clear;
edit5.clear;
edit6.clear;
end;

end.
Und ich habe folgendes Proplem. Habe jetzt 6 weitere Edits gemacht und möchte das wenn man unten zahlen rein schreibt das delphi die geschriebenen zahlen mit den zufalls zahlen in den anderen edits vergleicht und wenn alle übereinstimmen soll er mitels showmessage sagen das man gewonnen hat und wenn nicht das man verloren hat.
Das Haupt proplem ist ich weiß nciht wie ich es schreiben soll das er die zahlen überprüft also vergleicht.
  Mit Zitat antworten Zitat
 


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 14:44 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz