Sub main()
Dim num(10)
Dim ruote(5)
Dim poste(5)
poste(2)=1
poste(3)=1
poste(4)=1
poste(5)=1
tmp=InputBox("Quante estrazioni controllo?",,250)
fin=EstrazioneFin
ini=fin-tmp
For es=ini To fin
Messaggio CStr (EstrazioneFin - es)
For r=1 To 10
If r=11 Then r=12
a1=Estratto(es,r,1)
a2=Estratto(es,r,2)
a3=Estratto(es,r,3)
a4=Estratto(es,r,4)
a5=Estratto(es,r,5)
b1=819-a1
b2=b1-a2
b3=b2-a3
b4=b3-a4
b5=b4-a5
x1=Fuori90(b1)
x2=Fuori90(b2)
x3=Fuori90(b3)
x4=Fuori90(b4)
x5=Fuori90(b5)
xx1=x5-x1
If x5<x1 Then xx1=(x5+90)-x1
xx2=x4-x2
If x4<x2 Then xx2=(x4+90)-x2
xx3=x2-x4
If x2<x4 Then xx3=(x2+90)-x4
xx4=x1-x5
If x1<x5 Then xx4=(x1+90)-x5
y1=xx2-xx1
If xx2<xx1 Then y1=(xx2+90)-xx1
y2=xx3-xx2
If xx3<xx2 Then y2=(xx3+90)-xx2
y3=xx4-xx3
If xx4<xx3 Then y3=(xx4+90)-xx3
If xx1=00 Then xx1=90
If xx2=00 Then xx2=90
If xx3=00 Then xx3=90
If xx4=00 Then xx4=90
If y1=00 Then y1=90
If y2=00 Then y2=90
If y3=00 Then y3=90
Scrivi DataEstrazione(es),True
Scrivi Left(NomeRuota(r),3)&" "& StringaEstratti(es,r)
Scrivi
Scrivi "LINEA --> "&"819"&" "&b1&" "&b2&" "&b3&" "&b4&" "&b5
Scrivi "NUMERI --> "&Format2(a1)&" "&Format2(a2)&" "&Format2(a3)&" "&Format2(a4)&" "&Format2(a5)
Scrivi
Scrivi "NUMERI --> "&Format2(x1)&" "&Format2(x2)&" "&Format2(x3)&" "&Format2(x4)&" "&Format2(x5)
Scrivi "BILANC. --> "&Format2(x5)&" "&Format2(x4)&" "&Format2(x3)&" "&Format2(x2)&" "&Format2(x1)
Scrivi "EQUIDI. --> "&Format2(xx1)&" "&Format2(xx2)&" <> "&Format2(xx3)&" "&Format2(xx4)
Scrivi
Scrivi "NUM IN GIOCO --> "&Format2(Y1)&" "&Format2(Y2)&" "&Format2(Y3)
ruote(1)=r
num(1)=xx1
num(2)=xx2
num(3)=xx3
num(4)=xx4
num(5)=y1
num(6)=y2
num(7)=y3
ImpostaGiocata 1,num,ruote,poste,10
Gioca es
Scrivi"*****************************************************************"
Next
Next
ScriviResoconto
End Sub