Option Explicit
Sub Main
Dim T,T2,T1,T3,T4,T5,T6,T7,T8,T9,T10
Dim A,B,C,D,X,Y,R,V,K,L
Dim N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15
Dim A2,B2,C2,D2,J,G
Dim S1,S2,S3,E,qq,Xfine
Dim F(6),Estrat(6),P1,P2,P3,P4,P5,P6
Dim ES,RS,S,N
Dim Ambata(1),Ambo(2),posta(1),poste(2)
Dim Ruota(1),Ruote(5),Anumeri(50)
Dim Numeri(20),TV,EX
TV = InputBox("Quante Estrazione vuoi controllare",,0)
EX = EstrazioniArchivioSE - TV
For K = EX To EX
Estrat(1) = EstrattoSE(K,1)
Estrat(2) = EstrattoSE(K,2)
Estrat(3) = EstrattoSE(K,3)
Estrat(4) = EstrattoSE(K,4)
Estrat(5) = EstrattoSE(K,5)
Estrat(6) = EstrattoSE(K,6)
'------------------------
If ScriptInterrotto Then Exit Sub
For Y = 1 To 40
N = 6
For S = 0 To 3
E = 1
F(1) = E*(N - 6 + S) *(N - 5 + S) + Y
F(2) = E*(N - 5 + S) *(N - 4 + S) + Y
F(3) = E*(N - 4 + S) *(N - 3 + S) + Y
F(4) = E*(N - 3 + S) *(N - 2 + S) + Y
F(5) = E*(N - 2 + S) *(N - 1 + S) + Y
F(6) = E*(N - 1 + S) *(N - 0 + S) + Y
'-----------------------------------
OrdinaMatrice F,1
'If F(6) < 91 Then
'---------------------------------
qq = qq + 1
Messaggio(ES & " Tcomb.Elab: " & qq & " Trovate " & Xfine & " Su 40 Impostato N = " & Y)
'-------------------------------
T = Array(T,"1°"," ","2°"," ","3°"," ","4°"," ","5°"," ","6°")
Call InitTabella(T,Blu_,"center",3,Verde_,"Raavi")
'-------------------------------
'-------------------------------
T1 = Array(T1,Format2(F(1))," ",Format2(F(2))," ",Format2(F(3))," ",Format2(F(4))," ",Format2(F(5))," ",Format2(F(6)))
Call AddRigaTabella(T1,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(0,0,255),RGB(250,250,250))
Call SetColoreCella(2,RGB(0,0,255),RGB(0,0,0))
Call SetColoreCella(3,RGB(0,0,255),RGB(250,250,250))
Call SetColoreCella(4,RGB(0,0,255),RGB(0,0,0))
Call SetColoreCella(5,RGB(0,0,255),RGB(250,250,250))
Call SetColoreCella(6,RGB(0,0,255),RGB(0,0,0))
Call SetColoreCella(7,RGB(0,0,255),RGB(250,250,250))
Call SetColoreCella(8,RGB(0,0,255),RGB(0,0,0))
Call SetColoreCella(9,RGB(0,0,255),RGB(250,250,250))
Call SetColoreCella(10,RGB(0,0,255),RGB(0,0,0))
Call SetColoreCella(11,RGB(0,0,255),RGB(250,250,250))
'-------------------------------
'-------------------------------
N1 =(F(2) - F(1)) : N1 =("+") & N1
N2 =(F(3) - F(2)) : N2 =("+") & N2
N3 =(F(4) - F(3)) : N3 =("+") & N3
N4 =(F(5) - F(4)) : N4 =("+") & N4
N5 =(F(6) - F(5)) : N5 =("+") & N5
'------------------------------------------------
For X = 1 To 6
If Estrat(X) = F(1) Then Call SetColoreCella(1,RGB(14,211,92),RGB(250,250,250))
If Estrat(X) = F(2) Then Call SetColoreCella(3,RGB(14,211,92),RGB(250,250,250))
If Estrat(X) = F(3) Then Call SetColoreCella(5,RGB(14,211,92),RGB(250,250,250))
If Estrat(X) = F(4) Then Call SetColoreCella(7,RGB(14,211,92),RGB(250,250,250))
If Estrat(X) = F(5) Then Call SetColoreCella(9,RGB(14,211,92),RGB(250,250,250))
If Estrat(X) = F(6) Then Call SetColoreCella(11,RGB(14,211,92),RGB(250,250,250))
Next
'
T2 = Array(T2," 1 ",(N1)," ",(N2)," ",(N3)," ",(N4)," ",(N5)," ")
Call AddRigaTabella(T2,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(255,255,255),RGB(250,0,250))
Call SetColoreCella(2,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(8,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
'-------------------------------
N1 =(F(2) - F(1))
N2 =(F(3) - F(2))
N3 =(F(4) - F(3))
N4 =(F(5) - F(4))
N5 =(F(6) - F(5))
'---------------------------------
If N1 > N2 Then N6 = N1 - N2 : N6 = "-" & N6 End If
If N2 > N1 Then N6 = N2 - N1 : N6 = "+" & N6 End If
If N2 > N3 Then N7 = N2 - N3 : N7 = "-" & N7 End If
If N3 > N2 Then N7 = N3 - N2 : N7 = "+" & N7 End If
If N3 > N4 Then N8 = N3 - N4 : N8 = "-" & N8 End If
If N4 > N3 Then N8 = N4 - N3 : N8 = "+" & N8 End If
If N4 > N5 Then N9 = N4 - N5 : N9 = "-" & N9 End If
If N5 > N4 Then N9 = N5 - N4 : N9 = "+" & N9 End If
'
If N1 = N2 Then N6 = N1 - N2 : N6 = "-" & N6 End If
If N2 = N3 Then N7 = N2 - N3 : N7 = "-" & N7 End If
If N3 = N4 Then N8 = N3 - N4 : N8 = "-" & N8 End If
If N4 = N5 Then N9 = N4 - N5 : N9 = "-" & N9 End If
'
T3 = Array(T3," 2 "," ",(N6)," ",(N7)," ",(N8)," ",(N9)," "," ")
Call AddRigaTabella(T3,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(255,255,255),RGB(250,0,250))
Call SetColoreCella(3,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(7,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
'--------------------------------
'--------------------------------
N6 = N2 - N1
N7 = N3 - N2
N8 = N4 - N3
N9 = N5 - N4
'
If N6 > N7 Then N10 = N6 - N7 : N10 = "-" & N10 End If
If N7 > N6 Then N10 = N7 - N6 : N10 = "+" & N10 End If
If N7 > N8 Then N11 = N7 - N8 : N11 = "-" & N11 End If
If N8 > N7 Then N11 = N8 - N7 : N11 = "+" & N11 End If
If N8 > N9 Then N12 = N8 - N9 : N12 = "-" & N12 End If
If N9 > N8 Then N12 = N9 - N8 : N12 = "+" & N12 End If
'
If N6 = N7 Then N10 = N6 - N7 : N10 = "-" & N10 End If
If N7 = N8 Then N11 = N7 - N8 : N11 = "-" & N11 End If
If N8 = N9 Then N12 = N8 - N9 : N12 = "-" & N12 End If
'
T4 = Array(T4," 3 "," "," ",(N10)," ",(N11)," ",(N12)," "," "," ")
Call AddRigaTabella(T4,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(255,255,255),RGB(250,0,250))
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
N10 = N7 - N6
N11 = N8 - N7
N12 = N9 - N8
'
If N10 > N11 Then N13 = N10 - N11 : N13 = "-" & N13 End If
If N11 > N10 Then N13 = N11 - N10 : N13 = "+" & N13 End If
If N11 > N12 Then N14 = N11 - N12 : N14 = "-" & N14 End If
If N12 > N11 Then N14 = N12 - N11 : N14 = "+" & N14 End If
'
If N10 = N11 Then N13 = N10 - N11 : N13 = "-" & N13 End If
If N11 = N12 Then N14 = N11 - N12 : N14 = "-" & N14 End If
'
'
T5 = Array(T5," 4 "," "," "," ",(N13)," ",(N14)," "," "," "," ")
Call AddRigaTabella(T5,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(255,255,255),RGB(250,0,250))
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
N13 = N11 - N10
N14 = N12 - N11
'
If N13 > N14 Then N15 = N13 - N14 : N15 = "-" & N15 End If
If N14 > N13 Then N15 = N14 - N13 : N15 = "+" & N15 End If
'--------------------------------
If N13 = N14 Then N15 = N13 - N14 : N15 = "-" & N15 End If
'---------------------------------
'
T6 = Array(T6," 5 "," "," "," "," ",(N15)," "," "," "," "," ")
Call AddRigaTabella(T6,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(1,RGB(255,255,255),RGB(250,0,250))
Call SetColoreCella(11,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
T7 = Array(T7," "," "," "," "," "," "," "," "," "," "," ")
Call AddRigaTabella(T7,Bianco_,"center",3,Nero_,"Raavi")
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
'
If N15 = 0 Then
'--------------------------------
'--------------------------------
'--------------------------------
Call SetTableWidth("35%")
CreaTabella
Numeri(1) = Fuori90(F(1))
Numeri(2) = Fuori90(F(2))
Numeri(3) = Fuori90(F(3))
Numeri(4) = Fuori90(F(4))
Numeri(5) = Fuori90(F(5))
Numeri(6) = Fuori90(F(6))
Scrivi StringaNumeri(Numeri,"."),0,1,0,6,4
Scrivi("Sequence"),0,1,2,5,4
Scrivi
Scrivi("1°=" & E & " x (" & N - 6 & " + " & S & ") x (" & N - 5 & " + " & S & ") + " & Y & " =" & F(1) & ""),0,1,0,6,4
Scrivi("2°=" & E & " x (" & N - 5 & " + " & S & ") x (" & N - 4 & " + " & S & ") + " & Y & " =" & F(2) & ""),0,1,0,6,4
Scrivi("3°=" & E & " x (" & N - 4 & " + " & S & ") x (" & N - 3 & " + " & S & ") + " & Y & " =" & F(3) & ""),0,1,0,6,4
Scrivi("4°=" & E & " x (" & N - 3 & " + " & S & ") x (" & N - 2 & " + " & S & ") + " & Y & " =" & F(4) & ""),0,1,0,6,4
Scrivi("5°=" & E & " x (" & N - 2 & " + " & S & ") x (" & N - 1 & " + " & S & ") + " & Y & " =" & F(5) & ""),0,1,0,6,4
Scrivi("6°=" & E & " x (" & N - 1 & " + " & S & ") x (" & N - 0 & " + " & S & ") + " & Y & " =" & F(6) & ""),0,1,0,6,4
Scrivi
Xfine = Xfine + 1
Call ImpostaGiocataSE(1,Numeri,K,10,0)
Call GiocaSE(K)
Scrivi
ScriviEstrazioneSE(K)
Scrivi GetInfoEstrazioneSE(K)
Scrivi
End If
'End If
If Xfine = 250 Then Exit For
Next
If Xfine = 250 Then Exit For
Next
If Xfine = 250 Then Exit For
Next
End Sub