Option Explicit
Sub Main
Dim Ini,Fin
Dim r,k,e,n,nRit,nSfald,bMostraSoloRigheConNumeri,cMaxRigo,sNum,bValida,qNum
ReDim aRt(1)
ReDim aNumRuota(5)
Dim aBNumRuota
Dim t
Dim cIdRit,cIdRitMax,cIdFreq
Dim nFatte
Dim Parz
If MsgBox("Mostrare solo le righe alla cui posizione nel tab analitico sono effettivamente presenti dei numeri ?",vbQuestion + vbYesNo) = vbYes Then
bMostraSoloRigheConNumeri = True
End If
cMaxRigo = 250
cIdRit = 0
cIdRitMax = 1
cIdFreq = 2
t = Timer
ReDim aRitPerRigo(cMaxRigo,12,2)
Ini = EstrazioneIni
Fin = EstrazioneFin
nFatte = Fin -(Ini)
For r = 1 To 12
If r <> 11 Then
ReDim aN(90)
aRt(1) = r
Call GetRitardoEstratti(aRt,Ini ,aN)
For k = Ini+1 To Fin
'ReDim aTa(cMaxRigo,5)
Call GetArrayNumeriRuota(k,r,aNumRuota)
If aNumRuota(1) > 0 Then
For nRit = 0 To cMaxRigo
aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
Next
For e = 1 To 5
nRit = (aRitPerRigo(aN(aNumRuota(e)),r,cIdRit) -1)
If nRit >aRitPerRigo(aN(aNumRuota(e)),r,cIdRitMax) Then
aRitPerRigo(aN(aNumRuota(e)),r,cIdRitMax) = nRit
End If
aRitPerRigo(aN(aNumRuota(e)),r,cIdRit) =0
aRitPerRigo(aN(aNumRuota(e)),r,cIdFreq) =aRitPerRigo(aN(aNumRuota(e)),r,cIdFreq) +1
Next
aBNumRuota = ArrayNumeriToBool(aNumRuota)
For n = 1 To 90
If aBNumRuota(n) Then
aN(n) = 0
Else
aN(n) = aN(n) + 1
End If
'If aN(n) <= cMaxRigo Then
' If aTa(aN(n),0) < 5 Then
' aTa(aN(n),0) = aTa(aN(n),0) + 1
' aTa(aN(n),aTa(aN(n),0)) = n
' End If
' End If
Next
'For nRit = 0 To cMaxRigo
' If aTa(nRit,0) > 0 Then
' nSfald = 0
' Call GetArrayNumeriRuota(k + 1,r,aNumRuota)
' aBNumRuota = ArrayNumeriToBool(aNumRuota)
' For e = 1 To aTa(nRit,0)
' If aBNumRuota(aTa(nRit,e)) Then
' nSfald = nSfald + 1
' Exit For
' End If
' Next
' If nSfald > 0 Then
' If aRitPerRigo(nRit,r,cIdRit) > aRitPerRigo(nRit,r,cIdRitMax) Then
' aRitPerRigo(nRit,r,cIdRitMax) = aRitPerRigo(nRit,r,cIdRit)
' End If
' aRitPerRigo(nRit,r,cIdRit) = 0
' aRitPerRigo(nRit,r,cIdFreq) = aRitPerRigo(nRit,r,cIdFreq) + 1
' Else
' aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
' End If
' Else
' aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
' End If
' Next
End If
Next
End If
Call AvanzamentoElab(1,12,r)
Next
ReDim aV(10)
aV(1) = "Rigo"
aV(2) = "Ritardo"
aV(3) = "RitardoMax"
aV(4) = "Frequenza"
aV(5) = "Ruota"
aV(6) = "NumPresRigoAttuale"
aV(7) = "IndiceConv"
aV(8) = "QTeorica"
aV(9) = "QReale"
aV(10) = "Attendibilita"
Call GeneraAnaliticoTurbo(Fin)
Messaggio "Creazione tabella"
DoEventsEx
Call InitTabella(aV)
For r = 1 To 12
If r <> 11 Then
For k = 0 To cMaxRigo
aV(1) = k
aV(2) = aRitPerRigo(k,r,cIdRit)
aV(3) = aRitPerRigo(k,r,cIdRitMax)
aV(4) = aRitPerRigo(k,r,cIdFreq)
aV(5) = NomeRuota(r)
sNum = ""
qNum = 0
For e = 1 To 5
n = TabelloneAnaliticoTurbo(k,r,e)
If n > 0 Then
qNum = qNum + 1
sNum = sNum & n & "."
End If
Next
sNum = RimuoviLastChr(sNum,".")
bValida = False
If bMostraSoloRigheConNumeri Then
If sNum <> "" Then bValida = True
Else
bValida = True
End If
If bValida Then
aV(6) = sNum
aV(7) = Round(Dividi(aRitPerRigo(k,r,cIdRit),Dividi(nFatte,aRitPerRigo(k,r,cIdFreq))),3)
aV(8) = Round(QuantitaTeoricaCombAlRitX(k),3)
aV(9) = qNum
aV(10) = Round(Dividi(qNum,(qNum + CDbl(aV(8)))),3)
Call AddRigaTabella(aV)
End If
Next
End If
Next
Call Scrivi("Inizio : " & GetInfoEstrazione(Ini))
Call Scrivi("Fine : " & GetInfoEstrazione(Fin))
Call CreaTabella(2,,,100)
Scrivi Timer - t
End Sub
Rigo | Ritardo | RitardoMax | Frequenza | Ruota | NumPresRigoAttuale | IndiceConv | QTeorica | QReale | Attendibilita |
246 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
245 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
247 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
249 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
248 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
241 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
240 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
242 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
244 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
243 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
139 | 9196 | Torino | 0 | 0,002 | 0 | 0 | |||
138 | 9196 | Torino | 0 | 0,002 | 0 | 0 | |||
140 | 9196 | Torino | 0 | 0,002 | 0 | 0 | |||
143 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
142 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
114 | 9196 | Torino | 0 | 0,007 | 0 | 0 | |||
250 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
125 | 9196 | Torino | 0 | 0,004 | 0 | 0 | |||
133 | 9196 | Torino | 0 | 0,002 | 0 | 0 | |||
129 | 9196 | Torino | 0 | 0,003 | 0 | 0 | |||
226 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
225 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
227 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
229 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
228 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
221 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
220 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
222 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
224 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
223 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
236 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
235 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
237 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
239 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
238 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
231 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
230 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
232 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
234 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
233 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
180 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
179 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
182 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
184 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
183 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
175 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
174 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
176 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
178 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
177 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
191 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
190 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
192 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
194 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
193 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
186 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
185 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
187 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
189 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
188 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
158 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
155 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
159 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
162 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
160 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
148 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
147 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
149 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
152 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
151 | 9196 | Torino | 0 | 0,001 | 0 | 0 | |||
170 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
169 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
171 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
173 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
172 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
165 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
164 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
166 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
168 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
167 | 9196 | Torino | 0 | 0 | 0 | 0 | |||
164 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
163 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
165 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
167 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
166 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
158 | 9196 | Roma | 0 | 0,001 | 0 | 0 | |||
157 | 9196 | Roma | 0 | 0,001 | 0 | 0 | |||
160 | 9196 | Roma | 0 | 0,001 | 0 | 0 | |||
162 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
161 | 9196 | Roma | 0 | 0,001 | 0 | 0 | |||
174 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
173 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
175 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
177 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
176 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
169 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
168 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
170 | 9196 | Roma | 0 | 0 | 0 | 0 | |||
172 | 9196 | Roma | 0 | 0 | 0 | 0 |
Rigo | Ritardo | RitardoMax | Frequenza | Ruota | NumPresRigoAttuale | IndiceConv | QTeorica | QReale | Attendibilita |
117 | 5033 | 4156 | 1 | Firenze | 75 | 0,547 | 0,006 | 1 | 0,994 |
187 | 1759 | Nazionale | 53 | 0 | 0 | 1 | 1 | ||
80 | 530 | 1392 | 17 | Cagliari | 62 | 0,98 | 0,052 | 1 | 0,951 |
72 | 488 | 665 | 58 | Milano | 54 | 3,078 | 0,082 | 1 | 0,924 |
105 | 481 | 3344 | 8 | Bari | 28 | 0,418 | 0,012 | 1 | 0,988 |
75 | 455 | 1066 | 32 | Napoli | 49 | 1,583 | 0,069 | 1 | 0,935 |
67 | 426 | 921 | 59 | Milano | 32 | 2,733 | 0,109 | 1 | 0,902 |
91 | 361 | 1598 | 14 | Torino | 82 | 0,55 | 0,028 | 1 | 0,973 |
72 | 354 | 587 | 29 | Genova | 69 | 1,116 | 0,082 | 1 | 0,924 |
64 | 319 | 691 | 60 | Roma | 69 | 2,081 | 0,129 | 1 | 0,886 |
57 | 284 | 660 | 86 | Bari | 79 | 2,656 | 0,192 | 1 | 0,839 |
66 | 275 | 670 | 40 | Cagliari | 61 | 1,196 | 0,115 | 1 | 0,897 |
59 | 262 | 555 | 86 | Firenze | 70 | 2,45 | 0,172 | 1 | 0,853 |
68 | 191 | 501 | 61 | Napoli | 44 | 1,267 | 0,103 | 1 | 0,907 |
66 | 188 | 980 | 61 | Bari | 82 | 1,247 | 0,115 | 1 | 0,897 |
86 | 188 | 1795 | 15 | Bari | 4 | 0,307 | 0,037 | 1 | 0,964 |
55 | 184 | 396 | 70 | Cagliari | 30 | 1,4 | 0,216 | 1 | 0,822 |
68 | 154 | 892 | 6 | Nazionale | 60 | 0,1 | 0,103 | 1 | 0,907 |
Option Explicit
Sub Main
Dim Ini,Fin
Dim r,k,e,n,nRit,nSfald,bMostraSoloRigheConNumeri,cMaxRigo,sNum,bValida,qNum
Dim aBRuote
ReDim aRt(1)
ReDim aNumRuota(5)
Dim aBNumRuota
Dim t
Dim cIdRit,cIdRitMax,cIdFreq
Dim nFatte
Dim Parz
If MsgBox("Mostrare solo le righe alla cui posizione nel tab analitico sono effettivamente presenti dei numeri ?",vbQuestion + vbYesNo) = vbYes Then
bMostraSoloRigheConNumeri = True
End If
Call ScegliRuote(Nothing,aBRuote)
cMaxRigo = 250
cIdRit = 0
cIdRitMax = 1
cIdFreq = 2
t = Timer
ReDim aRitPerRigo(cMaxRigo,12,2)
Ini = EstrazioneIni
Fin = EstrazioneFin
nFatte = Fin -(Ini)
For r = 1 To 12
If r <> 11 Then
If aBRuote(r) Then
ReDim aN(90)
aRt(1) = r
Call GetRitardoEstratti(aRt,Ini,aN)
For k = Ini + 1 To Fin
'ReDim aTa(cMaxRigo,5)
Call GetArrayNumeriRuota(k,r,aNumRuota)
If aNumRuota(1) > 0 Then
For nRit = 0 To cMaxRigo
aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
Next
For e = 1 To 5
nRit =(aRitPerRigo(aN(aNumRuota(e)),r,cIdRit) - 1)
If nRit > aRitPerRigo(aN(aNumRuota(e)),r,cIdRitMax) Then
aRitPerRigo(aN(aNumRuota(e)),r,cIdRitMax) = nRit
End If
aRitPerRigo(aN(aNumRuota(e)),r,cIdRit) = 0
aRitPerRigo(aN(aNumRuota(e)),r,cIdFreq) = aRitPerRigo(aN(aNumRuota(e)),r,cIdFreq) + 1
Next
aBNumRuota = ArrayNumeriToBool(aNumRuota)
For n = 1 To 90
If aBNumRuota(n) Then
aN(n) = 0
Else
aN(n) = aN(n) + 1
End If
'If aN(n) <= cMaxRigo Then
' If aTa(aN(n),0) < 5 Then
' aTa(aN(n),0) = aTa(aN(n),0) + 1
' aTa(aN(n),aTa(aN(n),0)) = n
' End If
' End If
Next
'For nRit = 0 To cMaxRigo
' If aTa(nRit,0) > 0 Then
' nSfald = 0
' Call GetArrayNumeriRuota(k + 1,r,aNumRuota)
' aBNumRuota = ArrayNumeriToBool(aNumRuota)
' For e = 1 To aTa(nRit,0)
' If aBNumRuota(aTa(nRit,e)) Then
' nSfald = nSfald + 1
' Exit For
' End If
' Next
' If nSfald > 0 Then
' If aRitPerRigo(nRit,r,cIdRit) > aRitPerRigo(nRit,r,cIdRitMax) Then
' aRitPerRigo(nRit,r,cIdRitMax) = aRitPerRigo(nRit,r,cIdRit)
' End If
' aRitPerRigo(nRit,r,cIdRit) = 0
' aRitPerRigo(nRit,r,cIdFreq) = aRitPerRigo(nRit,r,cIdFreq) + 1
' Else
' aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
' End If
' Else
' aRitPerRigo(nRit,r,cIdRit) = aRitPerRigo(nRit,r,cIdRit) + 1
' End If
' Next
End If
Next
End If
End If
Call AvanzamentoElab(1,12,r)
Next
ReDim aV(10)
aV(1) = "Rigo"
aV(2) = "Ritardo"
aV(3) = "RitardoMax"
aV(4) = "Frequenza"
aV(5) = "Ruota"
aV(6) = "NumPresRigoAttuale"
aV(7) = "IndiceConv"
aV(8) = "QTeorica"
aV(9) = "QReale"
aV(10) = "Attendibilita"
Call GeneraAnaliticoTurbo(Fin)
Messaggio "Creazione tabella"
DoEventsEx
Call InitTabella(aV)
For r = 1 To 12
If r <> 11 And aBRuote (r) Then
For k = 0 To cMaxRigo
aV(1) = k
aV(2) = aRitPerRigo(k,r,cIdRit)
aV(3) = aRitPerRigo(k,r,cIdRitMax)
aV(4) = aRitPerRigo(k,r,cIdFreq)
aV(5) = NomeRuota(r)
sNum = ""
qNum = 0
For e = 1 To 5
n = TabelloneAnaliticoTurbo(k,r,e)
If n > 0 Then
qNum = qNum + 1
sNum = sNum & n & "."
End If
Next
sNum = RimuoviLastChr(sNum,".")
bValida = False
If bMostraSoloRigheConNumeri Then
If sNum <> "" Then bValida = True
Else
bValida = True
End If
If bValida Then
aV(6) = sNum
aV(7) = Round(Dividi(aRitPerRigo(k,r,cIdRit),Dividi(nFatte,aRitPerRigo(k,r,cIdFreq))),3)
aV(8) = Round(QuantitaTeoricaCombAlRitX(k),3)
aV(9) = qNum
aV(10) = Round(Dividi(qNum,(qNum + CDbl(aV(8)))),3)
Call AddRigaTabella(aV)
End If
Next
End If
Next
Call Scrivi("Inizio : " & GetInfoEstrazione(Ini))
Call Scrivi("Fine : " & GetInfoEstrazione(Fin))
Call SetTableWidth("100%")
Call CreaTabellaOrdinabile (2)
Scrivi Timer - t
End Sub
Option Explicit
Sub Main
Dim r
For r =0 To 100
Scrivi GetPresTeo (r) & " " & QuantitaTeoricaCombAlRitX (r)
Next
End Sub
Function GetPresTeo (Rit)
GetPresTeo =5*(17/18)^Rit
End Function
rudivall;n1996934 ha scritto:Ciao Alien, basta che scrivi così......
Call CreaTabellaOrdinabile(2,,,100) (CreaTabellaOrdinabile)
Scrivi Timer - t
End Sub
LuigiB;n1997013 ha scritto:ciao Joe . in questo script sono gestite le ruote.
Il calcolo dell'attendibilità che ho messo per te è esatto ?
Quale altro valore dobbiamo mettere ?
]