REM SKORLOTO 2005 COMBINATOR (in TURKISH) REM OBLIGATIONS & PROHIBITIONS (CHAOS FILTERS) WINDOW REM "PROHIBIT.FRM" REM "CreateAutomaticList" : COMBINATION GENERATOR Sub Routine REM ("Conditions" subroutine and others is kept hidden/secret for REM unwanted rival/competitor program derivations of SKORLOTO 2005 COMBINATOR program) REM SKORLOTO 2005 (v7.0) COMBINATOR (v5.0) "PROHIBIT.FRM" Declarations Dim T As Integer Dim u As Integer Dim v As Integer Dim w As Integer Dim X As Integer Dim y As Integer Dim Z As Integer Dim Hata As Boolean Dim S(49) As Integer Dim A As Integer Dim B As Long Dim C As Integer Rem Before Combinator Version 4.0 Rem B and D variables were Integer Rem Prohibited Combinations was not usable above 32767 Rem B and D have been changed to Long Rem 29-6-2003 Dim D As Long Dim E As Integer Dim F As Long Dim G As Long Dim H As Long Rem Combinator Version 4.0 [ 28-6-2003 ] Dim OD As Integer Dim SD As Integer Rem Playing List Size (Long) Rem But copy SKORLOTO.LST to SKORLOTO.OKL Rem needs Long Rem (It may be more than 13 million columns) Rem (At least, It may be more than 2 million columns) Dim OB As Long Rem Results Size (Integer < 32768) Dim SB As Integer Rem 29-6-2003 Rem Moved from Conditions subroutine Dim Tekrar As Integer Dim StepX As Integer Rem 19-7-2003 Dim HataNumarasi As Integer Rem 9-7-2005 Dim OLASILIK As Long Dim KayitNo As Long REM WARNING! June 21, 2006 ! REM BUG ! If all filters are disabled REM SKORLOTO 2005 COMBINATOR creates a wrong combination list! (Banko balls!?) REM I have not could find the reason of that, yet! (I am not concentrated my mind REM on v5.0 code) I am not using Visual Basic (6.0 etc.) for nowadays. REM I will use very different combination generator procedures REM in SKORLOTO 2006 Combinator (v6.0). So, Combinator v5.0 bugs must be fixed by REM other/derivation developers, if i will not fix that/those bug(s) REM in Combinator v5.0 (VB 6.0) source code. Private Sub CreateAutomaticList() Rem Revision 8 [ 9 July 2005 ] Combinator Version 5.0 Rem S(0), S(x) Optimization, "frmProhibit.caption=" speed optimization Rem Revision 7 [ 30 August 2003 ] Default Chaos Filtering Rem Revision 6 [ 19 July 2003 ] Rem HataNumarasi and On Error GoTo CLL_Hata On Error GoTo CCL_Hata Rem Revision 1 [ 11 November 2001 ] Rem Revision 2 [ 01 December 2001 ] Rem Revision 3 [ 25 March 2002 ] Rem Revision 4 [ 14 April 2002 ] BugFix [ Combinator v2.6.4 ] Rem Revision 5 [ 13 July 2003 ] Combinator Version 4.0 Hata = True n = Bag(0) If n > 0 Then For X = 1 To 49 S(X) = False Next X For X = 1 To Bag(0) If Bag(X) > 0 Then S(Bag(X)) = True End If Next X If Banko(0) > 0 Then For X = 1 To Banko(0) Rem Revision 1 [ 11 November 2001 ] Rem If S(Banko(x)) > 0 Then n = n - 1 Rem Revision 2 [ 28 December 2001 ] Rem Revision 3 [ 25 March 2002 ] Rem Revision 4 [ 20 April 2002 ] BugFix If S(Banko(X)) = True Then n = n - 1 S(Banko(X)) = False End If Next X End If For X = 1 To 49 If S(X) = True Then S(0) = S(0) + 1 S(S(0)) = X End If Next X End If r = 6 - Banko(0) OLASILIK = CombinationCount(n,r) Label10.Caption = "Toplam Kombinasyon = " + Str$(OLASILIK) Label11.Caption = "Uygun Kombinasyon = " Label12.Caption = "Başlama Zamanı = " Label13.Caption = "Bitiş Zamanı = " Rem Combinator Version 2.6 Rem 23-2-2002 Rem 1947792 combination count limit removed (Unlimited Listing) If OLASILIK = 0 Then Beep MsgBox ("Listelenecek herhangi bir kombinasyon yok !" + Chr$(13) + Chr$(13) + "n=" + Str$(n) + Chr$(13) + "r=" + Str$(r) + Chr$(13) + Chr$(13) + "Kombinasyon(n,r)=" + Str$(OLASILIK)), 48, "! HATA !" Exit Sub Else If OLASILIK = 1 Then Dim KolonTxt As String If Banko(0) > 0 Then For X = 1 To Banko(0) KolonTxt = KolonTxt + " " + Str$(Banko(X)) Next X End If For X = 1 To S(0) KolonTxt = KolonTxt + " " + Str$(S(X)) Next X Beep MsgBox ("Sadece 1 kombinasyon var !" + Chr$(13) + Chr$(13) + "Toplar: " + KolonTxt), 48, "SKORLOTO 2005 Kombinatör" Exit Sub Else Beep If MsgBox("Kombinasyonların toplam sayısı:" + Str$(OLASILIK) + Chr$(13) + Chr$(13) + "[ n=" + Str$(n) + ", r=" + Str$(r) + " ]" + Chr$(13) + Chr$(13) + "Yeni bir kombinasyon listesi oluşturmak istiyormusunuz ?", 36, "SKORLOTO 2005 Kombinatör") <> 6 Then Exit Sub frmProhibit.Caption = " Dosyalar hazırlanıyor..." HataNumarasi = 1 If UCase(Dir("SKORLOTO.LST")) = "SKORLOTO.LST" Then FileCopy "SKORLOTO.LST", "SKORLOTO.OLD" Kill "SKORLOTO.LST" End If End If End If Label12.Caption = "Başlama Zamanı = " + Time$ Hata = False HataNumarasi = 2 If Res1 = True Then If UCase(Dir("SKORLOTO.YS2")) = "SKORLOTO.YS2" Then C = FileLen("SKORLOTO.YS2") / 2 If C < 1 Or C > 1176 Then Res1 = False Kill "SKORLOTO.YS2" Else E = FreeFile Open "SKORLOTO.YS2" For Random As E Len = 2 C = FileLen("SKORLOTO.YS2") / 2 If C < 1 Or C > 1176 Then Res1 = False Else For X = 1 To 49 For y = 1 To 49 dual(X, y) = 0 Next y Next X For X = 1 To C Get E, X, y T = Int(y / 50) u = y - (T * 50) If T > 0 And T < 50 And u > 0 And u < 50 Then dual(T, u) = 1 dual(u, T) = 1 End If Next X End If Close E End If End If End If HataNumarasi = 3 If Res3 >= 0 Then If UCase(Dir("SKORLOTO.YSK")) = "SKORLOTO.YSK" Then D = FileLen("SKORLOTO.YSK") / Len(Kolon) If D < 1 Then Res3 = -1 Kill "SKORLOTO.YSK" Else A = FreeFile Open "SKORLOTO.YSK" For Random As A Len = Len(Kolon) D = FileLen("SKORLOTO.YSK") / Len(Kolon) If D < 1 Then Res3 = -1 Close A End If End If Else Res3 = -1 End If End If HataNumarasi = 4 Rem 28-6-2003 Playing (on Ticket) List File (new feature) If Res4 >= 0 Then If UCase(Dir("SKORLOTO.OKL")) = "SKORLOTO.OKL" Then OB = FileLen("SKORLOTO.OKL") / Len(Kolon) If OB < 1 Then Res4 = -1 Kill "SKORLOTO.OKL" Else OD = FreeFile Open "SKORLOTO.OKL" For Random As OD Len = Len(Kolon) OB = FileLen("SKORLOTO.OKL") / Len(Kolon) If OB < 1 Then Res4 = -1 Close OD End If End If Else Res4 = -1 End If End If HataNumarasi = 5 Rem 28-6-2003 TurnOuts (Results) File Rem 5-7-2003 If UCase(Dir("SKORLOTO.RES")) = "SKORLOTO.RES" Then SB = FileLen("SKORLOTO.RES") / Len(Kolon) If SB < 1 Then If Res5 >= 0 Then Res5 = -1 Kill "SKORLOTO.RES" End If If Res5 >= 0 Then SD = FreeFile Open "SKORLOTO.RES" For Random As SD Len = Len(Kolon) SB = FileLen("SKORLOTO.RES") / Len(Kolon) If SB < 1 Then Res5 = -1 Close SD End If Else If SB > 0 Then If S2HB = False And SH = False And SHSF <> -1 And SAAO = False And STAO = False And OGDF = False And SEA3B = False Then SB = 0 Else SD = FreeFile Open "SKORLOTO.RES" For Random As SD Len = Len(Kolon) SB = FileLen("SKORLOTO.RES") / Len(Kolon) If SB < 1 Then Close SD Kill "SKORLOTO.RES" End If End If End If End If Else If Res5 >= 0 Then Res5 = -1 SB = 0 End If Rem 5-Temmuz-2003 If S2HB = True Then If SB > 1 Then Get SD, SB - 1, Kolon S2H(1) = Kolon.Sayi1 S2H(2) = Kolon.Sayi2 S2H(3) = Kolon.Sayi3 S2H(4) = Kolon.Sayi4 S2H(5) = Kolon.Sayi5 S2H(6) = Kolon.Sayi6 Get SD, SB, Kolon S2H(7) = Kolon.Sayi1 S2H(8) = Kolon.Sayi2 S2H(9) = Kolon.Sayi3 S2H(10) = Kolon.Sayi4 S2H(11) = Kolon.Sayi5 S2H(12) = Kolon.Sayi6 Else S2HB = False SH = False End If Else If SH = True Then If SB >= 1 Then Get SD, SB, Kolon S2H(7) = Kolon.Sayi1 S2H(8) = Kolon.Sayi2 S2H(9) = Kolon.Sayi3 S2H(10) = Kolon.Sayi4 S2H(11) = Kolon.Sayi5 S2H(12) = Kolon.Sayi6 Else SH = False End If End If End If If SHSF = -1 Then If SB >= 1 Then Get SD, SB, Kolon SHSF = Kolon.Sayi6 - Kolon.Sayi1 Else SHSF = 0 End If Rem Else Rem SHSF = 0 End If If SB < 1 Then If SAAO = True Then SAAO = False If STAO = True Then STAO = False If OGDF = True Then OGDF = False If SEA3B = True Then SEA3B = False End If HataNumarasi = 6 Rem End of Combinator Version 4.0 File Additions Rem *** DosyaNo = FreeFile Open "SKORLOTO.LST" For Random As #DosyaNo Len = Len(Kolon) F = 1 Rem Banko is disabled or r= 6 Rem Combinator Version 5.0 [ 9 July 2005 ] frmProhibit.Caption = " Yeni kombinasyon listesi oluşturuluyor..." If Banko(0) = 0 Then For u = 1 To S(0) - 5 Kolon.Sayi1 = S(u) For v = u + 1 To S(0) - 4 Kolon.Sayi2 = S(v) For w = v + 1 To S(0) - 3 Kolon.Sayi3 = S(w) For X = w + 1 To S(0) - 2 Kolon.Sayi4 = S(X) For y = X + 1 To S(0) - 1 Kolon.Sayi5 = S(y) For Z = y + 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 417 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z Next y Next X Next w Next v Next u Else If Banko(0) = 1 Then Kolon.Sayi1 = Banko(1) For v = 1 To S(0) - 4 Kolon.Sayi2 = S(v) For w = v + 1 To S(0) - 3 Kolon.Sayi3 = S(w) For X = w + 1 To S(0) - 2 Kolon.Sayi4 = S(X) For y = X + 1 To S(0) - 1 Kolon.Sayi5 = S(y) For Z = y + 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 0 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z Next y Next X Next w Next v Else If Banko(0) = 2 Then Kolon.Sayi1 = Banko(1) Kolon.Sayi2 = Banko(2) For w = 1 To S(0) - 3 Kolon.Sayi3 = S(w) For X = w + 1 To S(0) - 2 Kolon.Sayi4 = S(X) For y = X + 1 To S(0) - 1 Kolon.Sayi5 = S(y) For Z = y + 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 0 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z Next y Next X Next w Else If Banko(0) = 3 Then Kolon.Sayi1 = Banko(1) Kolon.Sayi2 = Banko(2) Kolon.Sayi3 = Banko(3) For X = 1 To S(0) - 2 Kolon.Sayi4 = S(X) For y = X + 1 To S(0) - 1 Kolon.Sayi5 = S(y) For Z = y + 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 0 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z Next y Next X Else If Banko(0) = 4 Then Kolon.Sayi1 = Banko(1) Kolon.Sayi2 = Banko(2) Kolon.Sayi3 = Banko(3) Kolon.Sayi4 = Banko(4) For y = 1 To S(0) - 1 Kolon.Sayi5 = S(y) For Z = y + 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 0 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z Next y Else Kolon.Sayi1 = Banko(1) Kolon.Sayi2 = Banko(2) Kolon.Sayi3 = Banko(3) Kolon.Sayi4 = Banko(4) Kolon.Sayi5 = Banko(5) For Z = 1 To S(0) Kolon.Sayi6 = S(Z) If Conditions() = True Then Kolon.Referans = 0 Put #DosyaNo, F, Kolon F = F + 1 End If Next Z End If End If End If End If End If Pass_Formula: Close DosyaNo If SB >= 1 Then Close SD If Res4 >= 0 Then Close OD If Res3 >= 0 Then Close A If Rep = 0 Or Rep = 6 Then GoTo EndOfCCL End If HataNumarasi = 7 DosyaNo = FreeFile Open "SKORLOTO.LST" For Random As DosyaNo Len = Len(Kolon) G = FileLen("SKORLOTO.LST") / Len(Kolon) If G < 2 Then Close DosyaNo If SB >= 1 Then Close SD GoTo EndOfCCL End If frmProhibit.Caption = " Kombinasyon listesindeki tekrarlar eleniyor..." For F = 1 To G - 1 Get E, F, Kolon If Kolon.Referans = -1 Then GoTo Next_F End If Numara(1) = Kolon.Sayi1 Numara(2) = Kolon.Sayi2 Numara(3) = Kolon.Sayi3 Numara(4) = Kolon.Sayi4 Numara(5) = Kolon.Sayi5 Numara(6) = Kolon.Sayi6 For H = F + 1 To G y = 0 Get E, H, Kolon For X = 1 To 6 If Kolon.Sayi1 = Numara(X) Then y = y + 1 Exit For End If Next X For X = 1 To 6 If Kolon.Sayi2 = Numara(X) Then y = y + 1 Exit For End If Next X For X = 1 To 6 If Kolon.Sayi3 = Numara(X) Then y = y + 1 Exit For End If Next X If y >= Rep Then Kolon.Referans = -1 GoTo Next_H End If For X = 1 To 6 If Kolon.Sayi4 = Numara(X) Then y = y + 1 Exit For End If Next X If y >= Rep Then Kolon.Referans = -1 GoTo Next_H End If For X = 1 To 6 If Kolon.Sayi5 = Numara(X) Then y = y + 1 Exit For End If Next X If y >= Rep Then Kolon.Referans = -1 GoTo Next_H End If For X = 1 To 6 If Kolon.Sayi6 = Numara(X) Then y = y + 1 Exit For End If Next X If y >= Rep Then Kolon.Referans = -1 GoTo Next_H End If Next_H: Put E, H, Kolon Next H Next_F: Next F frmProhibit.Caption = " Kombinasyon listesi yeni dosyaya kayıtlanıyor..." HataNumarasi = 8 E = FreeFile If UCase(Dir("SKORLOTO.TMP")) = "SKORLOTO.TMP" Then Kill "SKORLOTO.TMP" End If Open "SKORLOTO.TMP" For Random As E Len = Len(Kolon) KayitNo = 0 For F = 1 To G Get DosyaNo, F, Kolon If Kolon.Referans <> -1 Then KayitNo = KayitNo + 1 Put E, KayitNo, Kolon End If Next F Close E Close DosyaNo HataNumarasi = 9 FileCopy "SKORLOTO.TMP", "SKORLOTO.LST" Kill "SKORLOTO.TMP" EndOfCCL: Label11.Caption = "Uygun Kombinasyon = " + Str$(FileLen("SKORLOTO.LST") / Len(Kolon)) Label13.Caption = "Bitiş Zamanı = " + Time$ CCL_Cikis: frmProhibit.Caption = " SKORLOTO 2005 Kombinatör [ YASAKLAR & ZORUNLULUKLAR ]" Exit Sub CCL_Hata: Hata = True Label11.Caption = "Hata oluştu..." Label13.Caption = "Hata zamanı =" + Time$ Resume CCL_Cikis End Sub REM 21-6-2006