Sub Main()
   ColoreTesto 2
   Scrivi "SPIA 90 SULLA NZ"
   Scrivi "GIOCA PREVISIONE ALGORITMICA SU BARI "
   Scrivi "METODO E LIST BY Marco"
   ColoreTesto 0
   Dim poste(3)
   Dim ruota(10)
   Dim n(4)
   poste(2) = 1
   clp = 12
   ini = EstrazioneFin - 3000
   fin = EstrazioneFin
   co = 0
   For es = ini To fin
      Messaggio es
      Call AvanzamentoElab(Ini,Fin,es)
      For x = 1 To 4
         n(x) = 0
      Next
      For r1 = 12 To 12
         For p1 = 1 To 5
            a = Estratto(es,r1,p1)
            ok = 0
            If Mese(es) = 1 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,3) + 1)
                  n(2) = Fuori90(90 +(Estratto(es,6,2)) - Estratto(es,6,4) + 8)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,10,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 1 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,3) + 1)
                  n(2) = Fuori90(Estratto(es,1,2) + Estratto(es,10,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 1 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,3) + 1)
                  n(2) = Fuori90(Estratto(es,3,1) + Estratto(es,3,5) + 9)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 1 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,3,3) + 1)
                  n(2) = Fuori90(Estratto(es,3,4) + Estratto(es,4,2) + 9)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 1 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,5,5) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 2 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  n(2) = Fuori90(Estratto(es,2,4) + Estratto(es,6,1) + 7)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 2 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,4) + 1)
                  n(2) = Fuori90(Estratto(es,7,3) + Estratto(es,10,5) + 13)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 2 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,3) + 1)
                  n(2) = Fuori90(Estratto(es,2,1) + Estratto(es,4,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 2 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,1) + 1)
                  n(2) = Fuori90(Estratto(es,8,3) + Estratto(es,10,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 2 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,1,3) + Estratto(es,10,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 3 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,4) + 1)
                  n(2) = Fuori90(Estratto(es,4,1) + Estratto(es,12,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 3 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,5) + 1)
                  n(2) = Fuori90(Estratto(es,1,3) + Estratto(es,10,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 3 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,5,4) + 1)
                  n(2) = Fuori90(Estratto(es,5,4) + Estratto(es,9,3) + 3)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 3 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,3,2) + Estratto(es,6,4) + 9)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 3 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,4,1) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,3,3) + 13)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 4 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,5) + 1)
                  n(2) = Fuori90(Estratto(es,6,3) + Estratto(es,8,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 4 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,4,3) + 1)
                  n(2) = Fuori90(Estratto(es,2,5) + Estratto(es,12,3) + 6)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 4 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,2) + 1)
                  n(2) = Fuori90(Estratto(es,5,2) + Estratto(es,7,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 4 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,8,1) + Estratto(es,8,3) + 13)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 4 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,4,2) + 1)
                  n(2) = Fuori90(Estratto(es,7,5) + Estratto(es,9,1) + 4)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 5 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,2) + 1)
                  n(2) = Fuori90(Estratto(es,2,5) + Estratto(es,4,5) + 2)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 5 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,2) + 1)
                  n(2) = Fuori90(Estratto(es,2,2) + Estratto(es,10,5) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 5 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,2) + 1)
                  n(2) = Fuori90(Estratto(es,7,4) + Estratto(es,10,2) + 16)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 5 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,8,4) + 1)
                  n(2) = Fuori90(Estratto(es,2,1) + Estratto(es,3,5) + 3)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,2,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 6 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,2) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,5,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 6 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,1,2) + Estratto(es,5,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 6 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,6,5) + 1)
                  n(2) = Fuori90(90 +(Estratto(es,10,1)) - Estratto(es,4,5) + 15)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 6 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,2,2) + 1)
                  n(2) = Fuori90(Estratto(es,3,4) + Estratto(es,4,3) + 3)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,4,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 6 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  n(2) = Fuori90(Estratto(es,4,2) + Estratto(es,9,4) + 2)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 7 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,3) + 1)
                  n(2) = Fuori90(Estratto(es,2,1) + Estratto(es,2,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 7 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,5,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 7 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,4) + 1)
                  n(2) = Fuori90(Estratto(es,5,5) + Estratto(es,8,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 7 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,1) + 1)
                  n(2) = Fuori90(Estratto(es,2,4) + Estratto(es,9,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 7 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,2) + 1)
                  n(2) = Fuori90(90 +(Estratto(es,10,5)) - Estratto(es,9,4) + 42)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 8 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,2) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,2,5) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 8 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,1) + 1)
                  n(2) = Fuori90(Estratto(es,1,5) + Estratto(es,3,5) + 11)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 8 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,4,2) + 1)
                  n(2) = Fuori90(Estratto(es,1,5) + Estratto(es,2,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 8 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,5) + 1)
                  n(2) = Fuori90(90 +(Estratto(es,2,5)) - Estratto(es,4,1) + 15)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 8 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,2) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 9 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,5,5) + Estratto(es,7,3) + 26)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,3,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 9 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,2,2) * Estratto(es,4,5) + 75)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 9 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,4,4) + 1)
                  n(2) = Fuori90(Estratto(es,1,2) + Estratto(es,3,3) + 2)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 9 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,5) + 1)
                  n(2) = Fuori90(Estratto(es,3,5) + Estratto(es,5,5) + 5)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 9 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,5) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,4,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 10 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,5) + 1)
                  n(2) = Fuori90(Estratto(es,1,2) + Estratto(es,6,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 10 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,2,1) + Estratto(es,4,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 10 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,5,3) + 1)
                  n(2) = Fuori90(Estratto(es,3,2) + Estratto(es,5,4) + 15)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,2,3) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 10 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,3) + 1)
                  n(2) = Fuori90(Estratto(es,2,4) + Estratto(es,12,2) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 10 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,2,1) + 1)
                  n(2) = Fuori90(Estratto(es,1,2) + Estratto(es,2,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 11 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,2) + 1)
                  n(2) = Fuori90(Estratto(es,1,1) + Estratto(es,1,5) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 11 Then
               If a = 90 And p1 = 3 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,1,4) + 1)
                  n(2) = Fuori90(Estratto(es,1,3) + Estratto(es,8,1) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 11 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,4,1) + Estratto(es,10,2) + 81)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 11 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,2,1) + Estratto(es,6,1) + 28)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 12 Then
               If a = 90 And p1 = 1 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,3,5) + 1)
                  n(2) = Fuori90(Estratto(es,2,3) + Estratto(es,7,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 12 Then
               If a = 90 And p1 = 2 Then
                  n(1) = Fuori90(Estratto(es,1,1) + Estratto(es,7,4) + 1)
                  n(2) = Fuori90(90 +(Estratto(es,7,4)) - Estratto(es,6,2) + 48)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,4,5) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 12 Then
               If a = 90 And p1 = 4 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,6,3) + 1)
                  n(2) = Fuori90(Estratto(es,1,4) + Estratto(es,10,4) + 8)
                  n(3) = Fuori90(Estratto(es,1,1) + Estratto(es,2,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If Mese(es) = 12 Then
               If a = 90 And p1 = 5 Then
                  n(1) = Fuori90(Estratto(es,1,2) + Estratto(es,5,3) + 1)
                  n(2) = Fuori90(Estratto(es,4,4) + Estratto(es,10,3) + 5)
                  n(3) = Fuori90(Estratto(es,1,2) + Estratto(es,2,4) + 1)
                  ruota(1) = 1
                  ok = 1
               End If
            End If
            If ok = 1 Then
               co = co + 1
               ColoreTesto 1
               Scrivi String(80,"*") & " Caso n°" & co,1
               Scrivi DataEstrazione(es,1) & " [ " & SiglaRuota(r1) & " - " & StringaEstratti(es,r1),1
               Scrivi String(80,"*"),1
               ColoreTesto 0
               ImpostaGiocata 1,n,ruota,poste,clp
               Gioca es,1
            End If
         Next
      Next
   Next
   ScriviResoconto
End Sub