IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası
  sohbet

Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 16 Nisan 2010, 12:30   #1
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Sayısal Loto




Bu programda amaç, 1-49 arasında 6 farklı rakamlar belirtilen çekiliş dizisinde tutulmaktadır. Girilen kolon sayısına göre bilgisayar rasgele 1 -49 arasında 6 farklı rakamlar oynamaktadır. Bu oynanan kolonları çeklişle karşılaştırmaktır..


Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.


PHP Kod:   Kodu kopyalamak için üzerine çift tıklayın!
Unit Unit1;interfaceusesWindowsMessagesSysUtilsVariantsClassesGraphicsControlsForms,DialogsStdCtrlsButtonsExtCtrls;typeTForm1 = class(TForm)Edit1TEdit;Label1TLabel;ListBox1TListBox;Edit2TEdit;Label2TLabel;Label3TLabel;Label4TLabel;Label5TLabel;Label6TLabel;Label7TLabel;Label8TLabel;Label9TLabel;Label10TLabel;Label11TLabel;Label12TLabel;Label13TLabel;Label14TLabel;Timer1TTimer;SpeedButton1TSpeedButton;SpeedButton2TSpeedButton;Timer2TTimer;Label15TLabel;Label16TLabel;procedure FormCreate(SenderTObject);procedure Timer1Timer(SenderTObject);procedure SpeedButton1Click(SenderTObject);procedure SpeedButton2Click(SenderTObject);procedure Timer2Timer(SenderTObject);procedure Label15Click(SenderTObject);procedure FormMouseMove(SenderTObjectShiftTShiftStateX,YInteger);procedure Label15MouseMove(SenderTObjectShiftTShiftStateX,YInteger);procedure Label15MouseDown(SenderTObjectButtonTMouseButton;ShiftTShiftStateXYInteger);private{ Private declarations }public{ Public declarations }end;varForm1TForm1;a:array[1..6of integer;//Çekiliş dizisib:array[1..6] of integer;//Kolonlar dizisisayac,seffaf:integer;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);beginAlphaBlend:=true;end;procedure TForm1.Timer1Timer(Sender: TObject);beginseffaf:=seffaf+5;AlphaBlendValue:=seffaf;if seffaf=255 thentimer1.Enabled:=false;end;procedure TForm1.SpeedButton1Click(Sender: TObject);vari,j,deger:integer;beginrandomize;//Bilgisayar, program açıldığında aynı rakamları ele almasın diye.a[1]:=random(49)+1;//Çekiliş dizisine 1-49 arasında 6 farklı rakam atanıyor.a[2]:=random(49)+1;a[3]:=random(49)+1;a[4]:=random(49)+1;a[5]:=random(49)+1;a[6]:=random(49)+1;for i:=1 to 6 dofor j:=i+1 to 6 doif a[i]=a[j] then a[i]:=a[i]+1;//Eğer bilgisayar rasgele aynı rakamlar tutar ise o rakamı bir arttır.for i:=1 to 6 dofor j:=i+1 to 6 doif a[i]>a[j] then//Sıralama algoritması.begindeger:=a[i];a[i]:=a[j];a[j]:=deger;end;edit1.Text:=inttostr(a[1])+? ?+inttostr(a[2])+? ?+inttostr(a[3])+? ?+inttostr(a[4])+? ?+inttostr(a[5])+? ?+inttostr(a[6]);//Çekiliş rakamları edit bileşenine yazdırılıyor.end;procedure TForm1.SpeedButton2Click(Sender: TObject);vari,j,deger,k:integer;beginlistbox1.Clear;//Önceden yazdırılan kolonlar bir daha listbox?da görünmesin.label9.Caption:=?0?;label10.Caption:=?0?;label11.Caption:=?0?;label12.Caption:=?0?;label13.Caption:=?0?;label14.Caption:=?0?;for k:=1 to strtoint(edit2.text) do//Belirtilen kolon sayısına göre dön.beginListBox1.Refresh;//Listbox?ı yenile, gözle görmemizi sağlar.label9.Refresh;label10.Refresh;label11.Refresh;label12.Refresh;label13.Refresh;label14.Refresh;randomize;b[1]:=random(49)+1;//Kolonlar dizisine 1-49 arasında 6 farklı rakamlar atanıyor.b[2]:=random(49)+1;b[3]:=random(49)+1;b[4]:=random(49)+1;b[5]:=random(49)+1;b[6]:=random(49)+1;for i:=1 to 6 dofor j:=i+1 to 6 doif b[i]=b[j] then b[i]:=b[i]+1;//Kolondaki sayılardan biri eşit ise bir arttır.for i:=1 to 6 dofor j:=i+1 to 6 doif b[i]>b[j] then//Sıralama algoritması.begindeger:=b[i];b[i]:=b[j];b[j]:=deger;end;for i:=1 to 6 dofor j:=1 to 6 doif a[i]=b[j] then sayac:=sayac+1;//Çekiliş rakamları Kolonlar rakamlarından birine eşit ise sayacımızı bir arttır.if sayac=1 then begin label9.Caption:=inttostr(strtoint(label9.Caption)+1); sayac:=0; end;//Eğer sayaç bir ise o kolonda bir tutturmuştur.if sayac=2 then begin label10.Caption:=inttostr(strtoint(label10.Caption)+1); sayac:=0; end;if sayac=3 then begin label11.Caption:=inttostr(strtoint(label11.Caption)+1); sayac:=0; end;if sayac=4 then begin label12.Caption:=inttostr(strtoint(label12.Caption)+1); sayac:=0; end;if sayac=5 then begin label13.Caption:=inttostr(strtoint(label13.Caption)+1); sayac:=0; end;if sayac=6 then begin label14.Caption:=inttostr(strtoint(label14.Caption)+1); sayac:=0; end;ListBox1.Items.Add(inttostr(k)+? ? ?+inttostr(b[1])+? ?+inttostr(b[2])+? ?+inttostr(b[3])+? ?+inttostr(b[4])+? ?+inttostr(b[5])+? ?+inttostr(b[6]));//Kolonlarımız listbox bileşinine yazdırılıyor.end;end;//Alt satırda bulunan kod kısımları tamamen görselliğe dayalıdır.procedure TForm1.Timer2Timer(Sender: TObject);beginseffaf:=seffaf-5;AlphaBlendValue:=seffaf;if seffaf=0 thenbegintimer1.Enabled:=false;halt;end;end;procedure TForm1.Label15Click(Sender: TObject);begintimer2.Enabled:=true;end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);beginlabel15.Font.Color:=clred;end;procedure TForm1.Label15MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);beginlabel15.Font.Color:=$006C6CFF;end;procedure TForm1.Label15MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);beginlabel15.Font.Color:=$000000B0;end;end.Unit Unit1;

interface

uses

Windows
MessagesSysUtilsVariantsClassesGraphicsControlsForms,
DialogsStdCtrlsButtonsExtCtrls;

type
TForm1 
= class(TForm)
Edit1TEdit;
Label1TLabel;
ListBox1TListBox;
Edit2TEdit;
Label2TLabel;
Label3TLabel;
Label4TLabel;
Label5TLabel;
Label6TLabel;
Label7TLabel;
Label8TLabel;
Label9TLabel;
Label10TLabel;
Label11TLabel;
Label12TLabel;
Label13TLabel;
Label14TLabel;
Timer1TTimer;
SpeedButton1TSpeedButton;
SpeedButton2TSpeedButton;
Timer2TTimer;
Label15TLabel;
Label16TLabel;
procedure FormCreate(SenderTObject);
procedure Timer1Timer(SenderTObject);
procedure SpeedButton1Click(SenderTObject);
procedure SpeedButton2Click(SenderTObject);
procedure Timer2Timer(SenderTObject);
procedure Label15Click(SenderTObject);
procedure FormMouseMove(SenderTObjectShiftTShiftStateX,
YInteger);
procedure Label15MouseMove(SenderTObjectShiftTShiftStateX,
YInteger);
procedure Label15MouseDown(SenderTObjectButtonTMouseButton;
ShiftTShiftStateXYInteger);
private
{ Private 
declarations }
public
{ Public 
declarations }
end;
var

Form1TForm1;
a:array[1..6of integer;//Çekiliş dizisi
b:array[1..6of integer;//Kolonlar dizisi
sayac,seffaf:integer;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(SenderTObject);
begin
AlphaBlend
:=true;
end;

procedure TForm1.Timer1Timer(SenderTObject);
begin
seffaf
:=seffaf+5;
AlphaBlendValue:=seffaf;
if 
seffaf=255 then
timer1
.Enabled:=false;
end;

procedure TForm1.SpeedButton1Click(SenderTObject);
var
i,j,deger:integer;
begin
randomize
;//Bilgisayar, program açıldığında aynı rakamları ele almasın diye.
a[1]:=random(49)+1;//Çekiliş dizisine 1-49 arasında 6 farklı rakam atanıyor.
a[2]:=random(49)+1;
a[3]:=random(49)+1;
a[4]:=random(49)+1;
a[5]:=random(49)+1;
a[6]:=random(49)+1;
for 
i:=1 to 6 do
for 
j:=i+1 to 6 do
if 
a[i]=a[jthen a[i]:=a[i]+1;//Eğer bilgisayar rasgele aynı rakamlar tutar ise o rakamı bir arttır.
for i:=1 to 6 do
for 
j:=i+1 to 6 do
if 
a[i]>a[jthen//Sıralama algoritması.
begin
deger
:=a[i];
a[i]:=a[j];
a[j]:=deger;
end;
edit1.Text:=inttostr(a[1])+? ?+inttostr(a[2])+? ?+inttostr(a[3])+? ?+inttostr(a[4])+? ?+inttostr(a[5])+? ?+inttostr(a[6]);//Çekiliş rakamları edit bileşenine yazdırılıyor.
end;

procedure TForm1.SpeedButton2Click(SenderTObject);
var
i,j,deger,k:integer;
begin
listbox1
.Clear;//Önceden yazdırılan kolonlar bir daha listbox?da görünmesin.
label9.Caption:=?0?;
label10.Caption:=?0?;
label11.Caption:=?0?;
label12.Caption:=?0?;
label13.Caption:=?0?;
label14.Caption:=?0?;
for 
k:=1 to strtoint(edit2.text) do//Belirtilen kolon sayısına göre dön.
begin
ListBox1
.Refresh;//Listbox?ı yenile, gözle görmemizi sağlar.
label9.Refresh;
label10.Refresh;
label11.Refresh;
label12.Refresh;
label13.Refresh;
label14.Refresh;
randomize;
b[1]:=random(49)+1;//Kolonlar dizisine 1-49 arasında 6 farklı rakamlar atanıyor.
b[2]:=random(49)+1;
b[3]:=random(49)+1;
b[4]:=random(49)+1;
b[5]:=random(49)+1;
b[6]:=random(49)+1;
for 
i:=1 to 6 do
for 
j:=i+1 to 6 do
if 
b[i]=b[jthen b[i]:=b[i]+1;//Kolondaki sayılardan biri eşit ise bir arttır.
for i:=1 to 6 do
for 
j:=i+1 to 6 do
if 
b[i]>b[jthen//Sıralama algoritması.
begin
deger
:=b[i];
b[i]:=b[j];
b[j]:=deger;
end;
for 
i:=1 to 6 do
for 
j:=1 to 6 do
if 
a[i]=b[jthen sayac:=sayac+1;//Çekiliş rakamları Kolonlar rakamlarından birine eşit ise sayacımızı bir arttır.
if sayac=1 then begin label9.Caption:=inttostr(strtoint(label9.Caption)+1); sayac:=0end;//Eğer sayaç bir ise o kolonda bir tutturmuştur.
if sayac=2 then begin label10.Caption:=inttostr(strtoint(label10.Caption)+1); sayac:=0end;
if 
sayac=3 then begin label11.Caption:=inttostr(strtoint(label11.Caption)+1); sayac:=0end;
if 
sayac=4 then begin label12.Caption:=inttostr(strtoint(label12.Caption)+1); sayac:=0end;
if 
sayac=5 then begin label13.Caption:=inttostr(strtoint(label13.Caption)+1); sayac:=0end;
if 
sayac=6 then begin label14.Caption:=inttostr(strtoint(label14.Caption)+1); sayac:=0end;
ListBox1.Items.Add(inttostr(k)+? ? ?+inttostr(b[1])+? ?+inttostr(b[2])+? ?+inttostr(b[3])+? ?+inttostr(b[4])+? ?+inttostr(b[5])+? ?+inttostr(b[6]));//Kolonlarımız listbox bileşinine yazdırılıyor.
end;
end;

//Alt satırda bulunan kod kısımları tamamen görselliğe dayalıdır.

procedure TForm1.Timer2Timer(SenderTObject);
begin
seffaf
:=seffaf-5;
AlphaBlendValue:=seffaf;
if 
seffaf=0 then
begin
timer1
.Enabled:=false;
halt;
end;
end;

procedure TForm1.Label15Click(SenderTObject);
begin
timer2
.Enabled:=true;
end;

procedure TForm1.FormMouseMove(SenderTObjectShiftTShiftStateX,
YInteger);
begin
label15
.Font.Color:=clred;
end;

procedure TForm1.Label15MouseMove(SenderTObjectShiftTShiftStateX,
YInteger);
begin
label15
.Font.Color:=$006C6CFF;
end;

procedure TForm1.Label15MouseDown(SenderTObjectButtonTMouseButton;
ShiftTShiftStateXYInteger);
begin
label15
.Font.Color:=$000000B0;
end;

end


 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları sohbet odaları Benimmekan Mobil Sohbet
Cevapla

Etiketler
loto, sayısal


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler
Stil

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
Sayısal Loto çekildi Desmont Haber Arşivi 0 15 Şubat 2015 00:25
Sayısal Loto Çekildi Düş Haber Arşivi 0 10 Temmuz 2011 00:16
Sayısal Loto çekildi Lucifer Haber Arşivi 0 27 Şubat 2010 23:58
sayısal loto GirLMooN Fıkra 1 10 Haziran 2008 22:49