Sub main()
Dim so(4)
Dim ruote(11)
Dim rt(8)
Dim ruor(6),lun(6)
ReDim ne(4),num(4),de(4),ca(4)
Dim SA(6),DA(12)
ReDim TS(3),TSC(3)
Dim poambata(5),poambo(5),poterno(5),poquaterna(5)
Dim nu(2),na(8),na1(8)
poambata(1)=1 : poambo(2)=1 :poterno(3)=1:poquaterna(4)=1
ColoreTesto 2
Scrivi String(75,"*"),1
ColoreTesto 0
Scrivi String (25," ")& "Ambi Simmetrici in decina",1
ColoreTesto 1
Scrivi String (15," ")& "°°°esselotto°°° per ***arcor*** LottoCed",1
ColoreTesto 2
Scrivi String(75,"*"),1
ColoreTesto 0
Scrivi String(75,"_"),1
Scrivi String(75,"_"),1
indietro=CInt(InputBox ("Quante Estrazioni vuoi esaminare ?..","Simmetrici",100))
If indietro= False Then Exit Sub
colpis=CInt(InputBox ("Colpi di gioco?..","Simmetrici",9))
If colpis= False Then Exit Sub
clp=colpis
co=0
ini=EstrazioneFin -indietro
fin=EstrazioneFin
For es=ini To fin
Messaggio "elaborazione. estraz. "&(es)
For r=1 To 10
rt(1)=r
For p=1 To 4
For pp= p+1 To 5
ne(1)=Estratto (es,r,p)
ne(2)=Estratto (es,r,pp)
di1=Abs (ne(1)- ne(2))
d1=Decina (ne(1))
d2= Decina (ne(2))
If di1=3 Or di1=6 Then
If d1=d2 Then
num(1)=ne(1): num(2)=ne(2)
Call OrdinaMatrice (num,1,1)
If di1=3 Then man1=num(1)+6:d3=Decina (man1)
If d3<>d1 Then
man1=(num(1)-3):d3=Decina (man1)
End If
If di1=6 Then man1=num(1)+3:d3=Decina (man1)
com1=(90-ne(1))
com2=(90-ne(2))
com3=(90-man1)
TSC(1)=com1
TSC(2)=com2
TSC(3)=com3
TS(1)=ne(1)
TS(2)=ne(2)
TS(3)=man1
t1=0:t2=0
For rr=1 To 10
If rr<>r Then
k=p:kk=pp
a=Estratto (es,rr,k)
b=Estratto (es,rr,kk)
If a= ne(1) Or a=ne(2)Or a=man1 Then t1=1:ruos=rr:ne(3)=a 'rilevo isotopismo
If b= ne(1) Or b=ne(2)Or b=man1 Then t1=1:ruos=rr:ne(3)=b
If a= com1 Or a=com2 Or a=com3 Then t2=1:ruot=rr:ne(4)=a
If b= com1 Or b=com2 Or b=com3 Then t2=1:ruot=rr:ne(4)=b
If t1=1 And t2=1 Then
t1=0:t2=0
'''' inizio calcolo
'''''' ordino le due matrici
Call OrdinaMatrice (TS,1)
Call OrdinaMatrice (TSC,1)
s1=Fuori90 (TS(1)+TS(2))
SA(1)=(90-s1)
DA(1)=(TS(1)-SA(1))
DA(2)=(TS(2)-SA(1))
s2=Fuori90 (TS(1)+TS(3))
SA(2)=(90-s2)
DA(3)=(TS(1)-SA(2))
DA(4)=(TS(3)-SA(2))
s3=Fuori90 (TS(2)+TS(3))
SA(3)=(90-s3)
DA(5)=(TS(2)-SA(3))
DA(6)=(TS(3)-SA(3))
s4=Fuori90 (TSC(1)+TSC(2))
SA(4)=(90-s4)
DA(7)=(TSC(1)-SA(4))
DA(8)=(TSC(2)-SA(4))
s5=Fuori90 (TSC(1)+TSC(3))
SA(5)=(90-s5)
DA(9)=(TSC(1)-SA(5))
DA(10)=(TSC(3)-SA(5))
s6=Fuori90 (TSC(2)+TSC(3))
SA(6)=(90-s6)
DA(11)=(TSC(2)-SA(6))
DA(12)=(TSC(3)-SA(6))
For j= 1 To 12
If DA(j)<1 Then DA(j)=DA(j)+90
Next
Call OrdinaMatrice (DA,1)
EliminaRipetuti (DA)
StringaNumeri (DA)
ss= 0
For j=LBound (DA) To UBound (DA)
If DA(j)>1 Then ss=ss+1
Next
For Q= 1 To 9
cr=0
For ra= 1 To 10
tr=0
lung=""
For j= 1 To ss
For ka= 1 To 5
If Estratto (es+q,ra,ka)=DA(j) Then tr=tr+1:lung=lung &" "& DA(j)
Next
Next
If tr> 1 Then ' '''' ambo o terno
cr=cr+1
ruor(cr)=ra ''''' assegna alla ruota ruor
lun(cr)=lung
tr=0
lung=""
End If
Next
If cr> 0 Then Exit For
Next
If cr>0 Then
ne(1)=Format2 (ne(1))
ne(2)=Format2 (ne(2))
ne(3)=Format2 (ne(3))
ne(4)=Format2 (ne(4))
man1=Format2(man1)
com1=Format2(com1)
com2=Format2(com2)
com3=Format2(com3)
co=co+1
Scrivi String(7