Option Explicit
Sub Main
Dim FIn,Ini,A,B,C,G,Clp,Es
Dim R1,R2,P1,P2,P3,Salvo50,K
Dim D1,D2,Caso,Casi,S1,S2,S3,S4,S5
Dim Amba(1),Ambo(2),Ruo(3)
Dim Posta(1),Poste(2),M(2),Num(4)
FIn = EstrazioneFin
Ini = CInt(InputBox("Inserisci l'estrazione che vuoi iniziare",Salvo50,10817))'L'estrazione 6426 esempio nelle spiegazioni
Clp = CInt(InputBox(" Per quanti colpi vuoi giocare?",Salvo50,13))
Call ScegliRange(Ini,FIn,Ini,FIn)
Scrivi Space(14) & " Metodo Iimothy di Osvaldo Manara - Script Salvo50" & Space(14),1,,4,,3,,1
Posta(1) = 1
Poste(2) = 1
For Es = Ini To FIn
Messaggio Es
AvanzamentoElab Ini,FIn,Es
Caso = 0
For R1 = 1 To 12
If R1 = 11 Then R1 = 12
For P1 = 1 To 4
P2 = P1 + 1
A = Estratto(Es,R1,P1)
B = Estratto(Es,R1,P2)
M(1) = A : M(2) = B
Call OrdinaMatrice(M,1)
D1 = M(2) - M(1)
S1 = Fuori90(D1 + M(2))
D2 = Fuori90((M(1) + 90) - D1)
For R2 = 1 To 12
If R2 = 11 Then R2 = 12
If R2 <> R1 Then
For P3 = 1 To 5
If P3 = P1 Or P3 = P2 Then
C = Estratto(Es,R2,P3)
If C = S1 Or C = D2 Then
Amba(1) = Fuori90(A + B)
S2 = Fuori90(M(2) + S1)
S3 = Fuori90(M(1) + D2)
S4 = Fuori90(M(1) + S1)
S5 = Fuori90(M(2) + D2)
Num(1) = S2 : Num(2) = S3 : Num(3) = S4 : Num(4) = S5
Caso = Caso + 1
Casi = Casi + 1
Scrivi String(89,"*") & " Casi Totali " & FormattaStringa(Casi,"0000"),1,,,1
Scrivi String(80,"*") & " Estrazione " &(Es) & " caso " & FormattaStringa(Caso,"0000"),1,,,2
Scrivi
ReDim MatrCasella(3,1)
MatrCasella(1,0) = R1
MatrCasella(1,1) = P1
MatrCasella(2,0) = R1
MatrCasella(2,1) = P2
MatrCasella(3,0) = R2
MatrCasella(3,1) = P3
Call DisegnaEstrazione(Es,MatrCasella,,vbBlue)
Scrivi
Scrivi Space(26) & Format2(M(2)) & " - " & Format2(M(1)) & " = " & Format2(D1),1
Scrivi Space(26) & Format2(M(2)) & " + " & Format2(D1) & " = " & Format2(S1),1,0
Scrivi " Numero da Cercare Isotopo",1
Scrivi Space(26) & Format2(M(1)) & " - " & Format2(D1) & " = " & Format2(D2),1,0
Scrivi " Numero da Cercare Isotopo",1
Scrivi
Scrivi Space(26) & Format2(A) & " + " & Format2(B) & " = " & Format2(Amba(1)),1,0
Scrivi " Ambata ",1
Scrivi Space(26) & Format2(M(2)) & " + " & Format2(S1) & " = " & Format2(S2),1,0
Scrivi " 1° Abbinamento Verticale",1
Scrivi Space(26) & Format2(M(1)) & " + " & Format2(D2) & " = " & Format2(S3),1,0
Scrivi " 2° Abbinamento Verticale",1
Scrivi Space(26) & Format2(M(1)) & " + " & Format2(S1) & " = " & Format2(S4),1,0
Scrivi " 1° Abbinamento Diagonale",1
Scrivi Space(26) & Format2(M(2)) & " + " & Format2(D2) & " = " & Format2(S5),1,0
Scrivi " 2° Abbinamento Diagonale",1
Scrivi
Ruo(1) = R1 : Ruo(2) = R2
EliminaRipetuti Num
G = 1
ImpostaGiocata G,Amba,Ruo,Posta,Clp,1
For K = 1 To UBound(Num)
If Amba(1) <> Num(K)Then
Ambo(1) = Amba(1): Ambo(2) = Num(K)
If Ambo(2) > 0 Then
G = G + 1
ImpostaGiocata G,Ambo,Ruo,Poste,Clp
End If
End If
Next
Gioca Es,,,1
End If
End If
Next
End If
Next
Next
Next
If ScriptInterrotto Then Exit Sub
Next
ScriviResoconto
Scrivi " Tempo Trascorso" & TempoTrascorso
End Sub