Jump to content

Sayısal Loto Tahmini


KintaRo
 Share

Recommended Posts

Simpson_Bart arkadaşımızın autoit le hazırladığı projeden esinlenerek AMS ile bir çalışma hazırladım. Küçük bir fonksiyonla 1'den 49'a kadar random sayılar üretip, sayıları tabloya yerleştiriyor, sıralıyor ve for döngüsü ile inputlara yazıyor.

[codebox]tSayi = {};
function sayiBul()
tSayi = {};
for i=1,6 do
Table.Insert(tSayi, Table.Count(tSayi)+1, Math.Random(1, 49))
end
Table.Sort(tSayi, nil)
end[/codebox]

[img]http://i.imgur.com/7XArH.png[/img]

Proje Dosyası:

[code]http://www.mediafire.com/?ts3xyx7o3f2iovn[/code]

Executable:

[code]http://www.mediafire.com/?yj07j68xsx67bjh[/code]
Link to comment
Share on other sites

Aynı sayılar gelmez:

[code]tSayi = {0,0,0,0,0,0};
function sayiBul()
for i=1,6 do
tSayi[i] = Math.Random(1, 49)
end
t = 1
while (t < 6) do
for i=1,6 do
for j=1,6 do
if (i ~= j) and (tSayi[i] == tSayi[j]) then
tSayi[i] = Math.Random(1, 49)
end
end
end
t = t + 1
end
Table.Sort(tSayi, nil)
end
[/code]

Edited by MostWanted
Link to comment
Share on other sites

[quote name='blackman12' date='08 December 2011 - 22:11 ' timestamp='1323375064' post='1125830']
Aynı sayılar gelmez:

[code]tSayi = {0,0,0,0,0,0};
function sayiBul()
for i=1,6 do
tSayi[i] = Math.Random(1, 49)
end
t = 1
while (t < 6) do
for i=1,6 do
for j=1,6 do
if (i ~= j) and (tSayi[i] == tSayi[j]) then
tSayi[i] = Math.Random(1, 49)
end
end
end
t = t + 1
end
Table.Sort(tSayi, nil)
end
[/code]
[/quote]

hata verdi bi bakı ver
http://www.hhresim.com/pictures/bdf1b7dfec485190f55ac674009cbd7e.png

Edited by m3hm3t1991
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...