Novità

come trasformare in numeri romani alcuni numeri arabi di una sotto stringa... ?

BaffoBlù

Advanced Member >GOLD<
Scusate se mi aggancio qui, ma dato che state trasformando le estrazioni in qualcos'altro
mi domandavo se potreste togliermi la curiosità.

Curiosità sul qualcosa che volevo da sempre osservare da un punto di vista "diverso".

Ci vuole uno script. (io li so fare, ma ne soffro troppo, non ci vedo bene...)

che trasformi tutti i numeri delle estrazioni (scegliendo la ruota in un (Input Box)

in Codice Binario.

Data, numero indice etc.. rimangono uguali.

solo i 5 estratti si vedono "Diversamente" (ossia in Binario)

quindi un estrazione con questi 5 estratti

01 * 02 * 03 * 04 * 05
dovrebbero visionarsi così :


00000001 * 00000010 * 00000011 * 00000100 * 00000101
si necessita di uno spaziatore (visibile) fra un numero e un altro.


--------------------------------------------------

per ricavare il numero binario basta dividere per 2 fino ad ottenere zero.

metto anche una tabella, di facile visione.

Codice:
DECIMALE     BINARIO      DECIMALE     BINARIO
1           00000001           51           00110011
2           00000010           52           00110100
3           00000011           53           00110101
4           00000100           54           00110110
5           00000101           55           00110111
6           00000110           56           00111000
7           00000111           57           00111001
8           00001000           58           00111010
9           00001001           59           00111011
10           00001010           60           00111100
11           00001011           61           00111101
12           00001100           62           00111110
13           00001101           63           00111111
14           00001110           64           01000000
15           00001111           65           01000001
16           00010000           66           01000010
17           00010001           67           01000011
18           00010010           68           01000100
19           00010011           69           01000101
20           00010100           70           01000110
21           00010101           71           01000111
22           00010110           72           01001000
23           00010111           73           01001001
24           00011000           74           01001010
25           00011001           75           01001011
26           00011010           76           01001100
27           00011011           77           01001101
28           00011100           78           01001110
29           00011101           79           01001111
30           00011110           80           01010000
31           00011111           81           01010001
32           00100000           82           01010010
33           00100001           83           01010011
34           00100010           84           01010100
35           00100011           85           01010101
36           00100100           86           01010110
37           00100101           87           01010111
38           00100110           88           01011000
39           00100111           89           01011001
40           00101000           90           01011010
41           00101001           91           01011011
42           00101010           92           01011100
43           00101011           93           01011101
44           00101100           94           01011110
45           00101101           95           01011111
46           00101110           96           01100000
47           00101111           97           01100001
48           00110000           98           01100010
49           00110001           99           01100011
50           00110010           100           01100100
 

felix10

Super Member >PLATINUM<
faccio quello che posso, e la verità non so nemmeno perché veramente lo sto facendo...
ci vogliono energie che non ho più come un tempo...
Magari perché ci vuoi bene!? E allo stesso tempo diventerai immortale! Tutti fino alla fine dei tempi si ricorderanno di te e del bene che hai fatto! E poi lo fai perché hai un cuore grande e quindi sai benissimo che l unica cosa che conta in questa vita è l'amore che si è donato senza ricevere nulla in cambio, un po' come Dio ecco! I più grandi maestri lo affermano.Dio è colui che dona tutto senza nulla in cambio! Comunque sia GRAZIE di CUORE BAFFO.
 

lottoLuke

Banned
@BaffoBlù forse e dico forse funziona ma non ti assicuro nulla.......
Scusate se mi aggancio qui, ma dato che state trasformando le estrazioni in qualcos'altro
mi domandavo se potreste togliermi la curiosità.

Curiosità sul qualcosa che volevo da sempre osservare da un punto di vista "diverso".

Ci vuole uno script. (io li so fare, ma ne soffro troppo, non ci vedo bene...)

che trasformi tutti i numeri delle estrazioni (scegliendo la ruota in un (Input Box)

in Codice Binario.

Data, numero indice etc.. rimangono uguali.

solo i 5 estratti si vedono "Diversamente" (ossia in Binario)


quindi un estrazione con questi 5 estratti

01 * 02 * 03 * 04 * 05
dovrebbero visionarsi così :


00000001 * 00000010 * 00000011 * 00000100 * 00000101
si necessita di uno spaziatore (visibile) fra un numero e un altro.


--------------------------------------------------

per ricavare il numero binario basta dividere per 2 fino ad ottenere zero.

metto anche una tabella, di facile visione.

Codice:
DECIMALE     BINARIO      DECIMALE     BINARIO
1           00000001           51           00110011
2           00000010           52           00110100
3           00000011           53           00110101
4           00000100           54           00110110
5           00000101           55           00110111
6           00000110           56           00111000
7           00000111           57           00111001
8           00001000           58           00111010
9           00001001           59           00111011
10           00001010           60           00111100
11           00001011           61           00111101
12           00001100           62           00111110
13           00001101           63           00111111
14           00001110           64           01000000
15           00001111           65           01000001
16           00010000           66           01000010
17           00010001           67           01000011
18           00010010           68           01000100
19           00010011           69           01000101
20           00010100           70           01000110
21           00010101           71           01000111
22           00010110           72           01001000
23           00010111           73           01001001
24           00011000           74           01001010
25           00011001           75           01001011
26           00011010           76           01001100
27           00011011           77           01001101
28           00011100           78           01001110
29           00011101           79           01001111
30           00011110           80           01010000
31           00011111           81           01010001
32           00100000           82           01010010
33           00100001           83           01010011
34           00100010           84           01010100
35           00100011           85           01010101
36           00100100           86           01010110
37           00100101           87           01010111
38           00100110           88           01011000
39           00100111           89           01011001
40           00101000           90           01011010
41           00101001           91           01011011
42           00101010           92           01011100
43           00101011           93           01011101
44           00101100           94           01011110
45           00101101           95           01011111
46           00101110           96           01100000
47           00101111           97           01100001
48           00110000           98           01100010
49           00110001           99           01100011
50           00110010           100           01100100
Option Explicit

Sub Main()
MsgBox "Benvenuto! Questo programma trasforma i numeri dell'estrazione in binario."
Dim ruota
ruota = InputBox("Inserisci la ruota dell'estrazione: ")

Dim estrazione
Dim estrazione_lista
Dim estrazione_corretta

Do
estrazione = InputBox("Inserisci i numeri dell'estrazione separati da spazi (esempio: 12 18 21 33 35): ")
estrazione_lista = Split(estrazione)

estrazione_corretta = True
Dim numero
For Each numero In estrazione_lista
If Not IsNumeric(numero) Then
estrazione_corretta = False
MsgBox "Errore: Assicurati di inserire solo numeri separati da spazi."
Exit For
End If
Next
Loop While Not estrazione_corretta

Dim estrazione_binaria
estrazione_binaria = estrazione_in_binario(estrazione)

If estrazione_binaria <> "" Then
MsgBox "Ruota: " & ruota & vbCrLf & "Estrazione in binario: " & estrazione_binaria
End If
End Sub

Function estrazione_in_binario(estrazione)
Dim estrazione_binaria
estrazione_binaria = ""
Dim numeri
For Each numeri In Split(estrazione)
Dim numero_int
On Error Resume Next
numero_int = CInt(numeri)
On Error GoTo 0

If Err.Number <> 0 Then
MsgBox "Errore: uno o più numeri non sono validi."
estrazione_in_binario = ""
Exit Function
End If

If numero_int <= 50 Then
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8)
Else
estrazione_binaria = estrazione_binaria & numeri
End If
estrazione_binaria = estrazione_binaria & " * "
Next
estrazione_in_binario = Left(estrazione_binaria, Len(estrazione_binaria) - 3) ' Rimuove gli ultimi 3 caratteri, ovvero lo spazio e il *
End Function

' Funzione per convertire un numero decimale in binario
Function Dec2Bin(NumeroDecimale, Lunghezza)
Dim i
Dim Binario
For i = Lunghezza - 1 To 0 Step -1
If NumeroDecimale And (2 ^ i) Then
Binario = Binario & "1"
Else
Binario = Binario & "0"
End If
Next
Dec2Bin = Binario
End Function

Main
 
Ultima modifica:

lotto_tom75

Advanced Premium Member
Scusate se mi aggancio qui, ma dato che state trasformando le estrazioni in qualcos'altro
mi domandavo se potreste togliermi la curiosità.

Curiosità sul qualcosa che volevo da sempre osservare da un punto di vista "diverso".

Ci vuole uno script. (io li so fare, ma ne soffro troppo, non ci vedo bene...)

che trasformi tutti i numeri delle estrazioni (scegliendo la ruota in un (Input Box)

in Codice Binario.

Data, numero indice etc.. rimangono uguali.

solo i 5 estratti si vedono "Diversamente" (ossia in Binario)


quindi un estrazione con questi 5 estratti

01 * 02 * 03 * 04 * 05
dovrebbero visionarsi così :


00000001 * 00000010 * 00000011 * 00000100 * 00000101
si necessita di uno spaziatore (visibile) fra un numero e un altro.


--------------------------------------------------

per ricavare il numero binario basta dividere per 2 fino ad ottenere zero.

metto anche una tabella, di facile visione.

Codice:
DECIMALE     BINARIO      DECIMALE     BINARIO
1           00000001           51           00110011
2           00000010           52           00110100
3           00000011           53           00110101
4           00000100           54           00110110
5           00000101           55           00110111
6           00000110           56           00111000
7           00000111           57           00111001
8           00001000           58           00111010
9           00001001           59           00111011
10           00001010           60           00111100
11           00001011           61           00111101
12           00001100           62           00111110
13           00001101           63           00111111
14           00001110           64           01000000
15           00001111           65           01000001
16           00010000           66           01000010
17           00010001           67           01000011
18           00010010           68           01000100
19           00010011           69           01000101
20           00010100           70           01000110
21           00010101           71           01000111
22           00010110           72           01001000
23           00010111           73           01001001
24           00011000           74           01001010
25           00011001           75           01001011
26           00011010           76           01001100
27           00011011           77           01001101
28           00011100           78           01001110
29           00011101           79           01001111
30           00011110           80           01010000
31           00011111           81           01010001
32           00100000           82           01010010
33           00100001           83           01010011
34           00100010           84           01010100
35           00100011           85           01010101
36           00100100           86           01010110
37           00100101           87           01010111
38           00100110           88           01011000
39           00100111           89           01011001
40           00101000           90           01011010
41           00101001           91           01011011
42           00101010           92           01011100
43           00101011           93           01011101
44           00101100           94           01011110
45           00101101           95           01011111
46           00101110           96           01100000
47           00101111           97           01100001
48           00110000           98           01100010
49           00110001           99           01100011
50           00110010           100           01100100

Anche io come il bravo lottoluke ti ho fatto una mia versione e a proposito di AI la velocità di sviluppo dei 90 casi analoghi al primo in meno di 10 secondi... è dovuta proprio a lei :) . Farlo tutto "a mano" mi avrebbe richiesto almeno 45 min e vari richiami di Santi... 😇

Codice:
Option Explicit
'project by baffoblu
'script by lottotom
Sub Main()
   MsgBox "trasformazione dei numeri delle estrazioni per la ruota voluta in binario."
   Dim ruota
   ruota = ScegliRuota
   Dim estrazione
   ReDim estrazione_lista(0)
   Dim estrazione_corretta
   Dim i
   Dim Inizio
   Dim fine
   Dim quanteultimeestrazioni
   quanteultimeestrazioni = CInt(InputBox("quante ultime estrazioni convertire in binarie?",,100))
   fine = EstrazioneFin
   Inizio = fine - quanteultimeestrazioni
   Dim c
  
   Scrivi
   Scrivi NomeRuota(ruota)
   Scrivi
   Scrivi "range temporale 'convertito' " & GetInfoEstrazione(Inizio) & " - " & GetInfoEstrazione(fine)
   Scrivi "numero di ultime estrazioni gestite " & fine-Inizio
   Scrivi
  
   For i = Inizio To fine
      estrazione = StringaEstratti(i,ruota," ")
      Call SplitByChar(estrazione," ",estrazione_lista)
      Scrivi StringaNumeri(estrazione_lista)
'      For c = 0 To UBound(estrazione_lista)
'         Scrivi "|" & estrazione_lista(c) & "|"
'         If ScriptInterrotto Then Exit For
'      Next
      For c = 0 To UBound(estrazione_lista)
         Select Case(estrazione_lista(c))
         Case 1
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000001 " & "<font color=red>" & "*" & "</font>"
         Case 2
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000010 " & "<font color=red>" & "*" & "</font>"
         Case 3
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000011 " & "<font color=red>" & "*" & "</font>"
         Case 4
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000100 " & "<font color=red>" & "*" & "</font>"
         Case 5
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000101 " & "<font color=red>" & "*" & "</font>"
         Case 6
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000110 " & "<font color=red>" & "*" & "</font>"
         Case 7
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000111 " & "<font color=red>" & "*" & "</font>"
         Case 8
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001000 " & "<font color=red>" & "*" & "</font>"
         Case 9
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001001 " & "<font color=red>" & "*" & "</font>"
         Case 10
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001010 " & "<font color=red>" & "*" & "</font>"
         Case 11
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001011 " & "<font color=red>" & "*" & "</font>"
         Case 12
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001100 " & "<font color=red>" & "*" & "</font>"
         Case 13
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001101 " & "<font color=red>" & "*" & "</font>"
         Case 14
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001110 " & "<font color=red>" & "*" & "</font>"
         Case 15
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001111 " & "<font color=red>" & "*" & "</font>"
         Case 16
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010000 " & "<font color=red>" & "*" & "</font>"
         Case 17
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010001 " & "<font color=red>" & "*" & "</font>"
         Case 18
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010010 " & "<font color=red>" & "*" & "</font>"
         Case 19
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010011 " & "<font color=red>" & "*" & "</font>"
         Case 20
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010100 " & "<font color=red>" & "*" & "</font>"
         Case 21
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010101 " & "<font color=red>" & "*" & "</font>"
         Case 22
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010110 " & "<font color=red>" & "*" & "</font>"
         Case 23
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010111 " & "<font color=red>" & "*" & "</font>"
         Case 24
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011000 " & "<font color=red>" & "*" & "</font>"
         Case 25
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011001 " & "<font color=red>" & "*" & "</font>"
         Case 26
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011010 " & "<font color=red>" & "*" & "</font>"
         Case 27
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011011 " & "<font color=red>" & "*" & "</font>"
         Case 28
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011100 " & "<font color=red>" & "*" & "</font>"
         Case 29
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011101 " & "<font color=red>" & "*" & "</font>"
         Case 30
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011110 " & "<font color=red>" & "*" & "</font>"
         Case 31
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011111 " & "<font color=red>" & "*" & "</font>"
         Case 32
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100000 " & "<font color=red>" & "*" & "</font>"
         Case 33
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100001 " & "<font color=red>" & "*" & "</font>"
         Case 34
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100010 " & "<font color=red>" & "*" & "</font>"
         Case 35
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100011 " & "<font color=red>" & "*" & "</font>"
         Case 36
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100100 " & "<font color=red>" & "*" & "</font>"
         Case 37
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100101 " & "<font color=red>" & "*" & "</font>"
         Case 38
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100110 " & "<font color=red>" & "*" & "</font>"
         Case 39
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100111 " & "<font color=red>" & "*" & "</font>"
         Case 40
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101000 " & "<font color=red>" & "*" & "</font>"
         Case 41
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101001 " & "<font color=red>" & "*" & "</font>"
         Case 42
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101010 " & "<font color=red>" & "*" & "</font>"
         Case 43
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101011 " & "<font color=red>" & "*" & "</font>"
         Case 44
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101100 " & "<font color=red>" & "*" & "</font>"
         Case 45
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101101 " & "<font color=red>" & "*" & "</font>"
         Case 46
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101110 " & "<font color=red>" & "*" & "</font>"
         Case 47
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101111 " & "<font color=red>" & "*" & "</font>"
         Case 48
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110000 " & "<font color=red>" & "*" & "</font>"
         Case 49
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110001 " & "<font color=red>" & "*" & "</font>"
         Case 50
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110010 " & "<font color=red>" & "*" & "</font>"
         Case 51
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110011 " & "<font color=red>" & "*" & "</font>"
         Case 52
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110100 " & "<font color=red>" & "*" & "</font>"
         Case 53
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110101 " & "<font color=red>" & "*" & "</font>"
         Case 54
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110110 " & "<font color=red>" & "*" & "</font>"
         Case 55
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110111 " & "<font color=red>" & "*" & "</font>"
         Case 56
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111000 " & "<font color=red>" & "*" & "</font>"
         Case 57
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111001 " & "<font color=red>" & "*" & "</font>"
         Case 58
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111010 " & "<font color=red>" & "*" & "</font>"
         Case 59
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111011 " & "<font color=red>" & "*" & "</font>"
         Case 60
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111100 " & "<font color=red>" & "*" & "</font>"
         Case 61
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111101 " & "<font color=red>" & "*" & "</font>"
         Case 62
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111110 " & "<font color=red>" & "*" & "</font>"
         Case 63
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111111 " & "<font color=red>" & "*" & "</font>"
         Case 64
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000000 " & "<font color=red>" & "*" & "</font>"
         Case 65
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000001 " & "<font color=red>" & "*" & "</font>"
         Case 66
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000010 " & "<font color=red>" & "*" & "</font>"
         Case 67
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000011 " & "<font color=red>" & "*" & "</font>"
         Case 68
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000100 " & "<font color=red>" & "*" & "</font>"
         Case 69
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000101 " & "<font color=red>" & "*" & "</font>"
         Case 70
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000110 " & "<font color=red>" & "*" & "</font>"
         Case 71
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000111 " & "<font color=red>" & "*" & "</font>"
         Case 72
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001000 " & "<font color=red>" & "*" & "</font>"
         Case 73
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001001 " & "<font color=red>" & "*" & "</font>"
         Case 74
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001010 " & "<font color=red>" & "*" & "</font>"
         Case 75
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001011 " & "<font color=red>" & "*" & "</font>"
         Case 76
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001100 " & "<font color=red>" & "*" & "</font>"
         Case 77
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001101 " & "<font color=red>" & "*" & "</font>"
         Case 78
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001110 " & "<font color=red>" & "*" & "</font>"
         Case 79
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001111 " & "<font color=red>" & "*" & "</font>"
         Case 80
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010000 " & "<font color=red>" & "*" & "</font>"
         Case 81
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010001 " & "<font color=red>" & "*" & "</font>"
         Case 82
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010010 " & "<font color=red>" & "*" & "</font>"
         Case 83
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010011 " & "<font color=red>" & "*" & "</font>"
         Case 84
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010100 " & "<font color=red>" & "*" & "</font>"
         Case 85
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010101 " & "<font color=red>" & "*" & "</font>"
         Case 86
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010110 " & "<font color=red>" & "*" & "</font>"
         Case 87
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010111 " & "<font color=red>" & "*" & "</font>"
         Case 88
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011000 " & "<font color=red>" & "*" & "</font>"
         Case 89
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011001 " & "<font color=red>" & "*" & "</font>"
         Case 90
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011010 " & "<font color=red>" & "*" & "</font>"
         End Select
         If ScriptInterrotto Then Exit For
      Next
      Scrivi StringaNumeri(estrazione_lista)
      If ScriptInterrotto Then Exit For
   Next
End Sub

👋🙂
 

BaffoBlù

Advanced Member >GOLD<
@BaffoBlù forse e dico forse funziona ma non ti assicuro nulla.......

Option Explicit

Sub Main()
MsgBox "Benvenuto! Questo programma trasforma i numeri dell'estrazione in binario."
Dim ruota
ruota = InputBox("Inserisci la ruota dell'estrazione: ")

Dim estrazione
Dim estrazione_lista
Dim estrazione_corretta

Do
estrazione = InputBox("Inserisci i numeri dell'estrazione separati da spazi (esempio: 12 18 21 33 35): ")
estrazione_lista = Split(estrazione)

estrazione_corretta = True
Dim numero
For Each numero In estrazione_lista
If Not IsNumeric(numero) Then
estrazione_corretta = False
MsgBox "Errore: Assicurati di inserire solo numeri separati da spazi."
Exit For
End If
Next
Loop While Not estrazione_corretta

Dim estrazione_binaria
estrazione_binaria = estrazione_in_binario(estrazione)

If estrazione_binaria <> "" Then
MsgBox "Ruota: " & ruota & vbCrLf & "Estrazione in binario: " & estrazione_binaria
End If
End Sub

Function estrazione_in_binario(estrazione)
Dim estrazione_binaria
estrazione_binaria = ""
Dim numeri
For Each numeri In Split(estrazione)
Dim numero_int
On Error Resume Next
numero_int = CInt(numeri)
On Error GoTo 0

If Err.Number <> 0 Then
MsgBox "Errore: uno o più numeri non sono validi."
estrazione_in_binario = ""
Exit Function
End If

If numero_int <= 50 Then
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8)
Else
estrazione_binaria = estrazione_binaria & numeri
End If
estrazione_binaria = estrazione_binaria & " * "
Next
estrazione_in_binario = Left(estrazione_binaria, Len(estrazione_binaria) - 3) ' Rimuove gli ultimi 3 caratteri, ovvero lo spazio e il *
End Function

' Funzione per convertire un numero decimale in binario
Function Dec2Bin(NumeroDecimale, Lunghezza)
Dim i
Dim Binario
For i = Lunghezza - 1 To 0 Step -1
If NumeroDecimale And (2 ^ i) Then
Binario = Binario & "1"
Else
Binario = Binario & "0"
End If
Next
Dec2Bin = Binario
End Function

Main
funzia alla grande ma fa solo un estrazione alla volta.

grazie lo stesso
 

BaffoBlù

Advanced Member >GOLD<
Anche io come il bravo lottoluke ti ho fatto una mia versione e a proposito di AI la velocità di sviluppo dei 90 casi analoghi al primo in meno di 10 secondi... è dovuta proprio a lei :) . Farlo tutto "a mano" mi avrebbe richiesto almeno 45 min e vari richiami di Santi... 😇

Codice:
Option Explicit
'project by baffoblu
'script by lottotom
Sub Main()
   MsgBox "trasformazione dei numeri delle estrazioni per la ruota voluta in binario."
   Dim ruota
   ruota = ScegliRuota
   Dim estrazione
   ReDim estrazione_lista(0)
   Dim estrazione_corretta
   Dim i
   Dim Inizio
   Dim fine
   Dim quanteultimeestrazioni
   quanteultimeestrazioni = CInt(InputBox("quante ultime estrazioni convertire in binarie?",,100))
   fine = EstrazioneFin
   Inizio = fine - quanteultimeestrazioni
   Dim c
 
   Scrivi
   Scrivi NomeRuota(ruota)
   Scrivi
   Scrivi "range temporale 'convertito' " & GetInfoEstrazione(Inizio) & " - " & GetInfoEstrazione(fine)
   Scrivi "numero di ultime estrazioni gestite " & fine-Inizio
   Scrivi
 
   For i = Inizio To fine
      estrazione = StringaEstratti(i,ruota," ")
      Call SplitByChar(estrazione," ",estrazione_lista)
      Scrivi StringaNumeri(estrazione_lista)
'      For c = 0 To UBound(estrazione_lista)
'         Scrivi "|" & estrazione_lista(c) & "|"
'         If ScriptInterrotto Then Exit For
'      Next
      For c = 0 To UBound(estrazione_lista)
         Select Case(estrazione_lista(c))
         Case 1
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000001 " & "<font color=red>" & "*" & "</font>"
         Case 2
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000010 " & "<font color=red>" & "*" & "</font>"
         Case 3
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000011 " & "<font color=red>" & "*" & "</font>"
         Case 4
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000100 " & "<font color=red>" & "*" & "</font>"
         Case 5
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000101 " & "<font color=red>" & "*" & "</font>"
         Case 6
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000110 " & "<font color=red>" & "*" & "</font>"
         Case 7
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000111 " & "<font color=red>" & "*" & "</font>"
         Case 8
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001000 " & "<font color=red>" & "*" & "</font>"
         Case 9
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001001 " & "<font color=red>" & "*" & "</font>"
         Case 10
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001010 " & "<font color=red>" & "*" & "</font>"
         Case 11
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001011 " & "<font color=red>" & "*" & "</font>"
         Case 12
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001100 " & "<font color=red>" & "*" & "</font>"
         Case 13
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001101 " & "<font color=red>" & "*" & "</font>"
         Case 14
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001110 " & "<font color=red>" & "*" & "</font>"
         Case 15
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001111 " & "<font color=red>" & "*" & "</font>"
         Case 16
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010000 " & "<font color=red>" & "*" & "</font>"
         Case 17
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010001 " & "<font color=red>" & "*" & "</font>"
         Case 18
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010010 " & "<font color=red>" & "*" & "</font>"
         Case 19
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010011 " & "<font color=red>" & "*" & "</font>"
         Case 20
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010100 " & "<font color=red>" & "*" & "</font>"
         Case 21
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010101 " & "<font color=red>" & "*" & "</font>"
         Case 22
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010110 " & "<font color=red>" & "*" & "</font>"
         Case 23
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010111 " & "<font color=red>" & "*" & "</font>"
         Case 24
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011000 " & "<font color=red>" & "*" & "</font>"
         Case 25
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011001 " & "<font color=red>" & "*" & "</font>"
         Case 26
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011010 " & "<font color=red>" & "*" & "</font>"
         Case 27
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011011 " & "<font color=red>" & "*" & "</font>"
         Case 28
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011100 " & "<font color=red>" & "*" & "</font>"
         Case 29
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011101 " & "<font color=red>" & "*" & "</font>"
         Case 30
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011110 " & "<font color=red>" & "*" & "</font>"
         Case 31
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011111 " & "<font color=red>" & "*" & "</font>"
         Case 32
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100000 " & "<font color=red>" & "*" & "</font>"
         Case 33
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100001 " & "<font color=red>" & "*" & "</font>"
         Case 34
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100010 " & "<font color=red>" & "*" & "</font>"
         Case 35
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100011 " & "<font color=red>" & "*" & "</font>"
         Case 36
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100100 " & "<font color=red>" & "*" & "</font>"
         Case 37
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100101 " & "<font color=red>" & "*" & "</font>"
         Case 38
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100110 " & "<font color=red>" & "*" & "</font>"
         Case 39
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100111 " & "<font color=red>" & "*" & "</font>"
         Case 40
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101000 " & "<font color=red>" & "*" & "</font>"
         Case 41
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101001 " & "<font color=red>" & "*" & "</font>"
         Case 42
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101010 " & "<font color=red>" & "*" & "</font>"
         Case 43
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101011 " & "<font color=red>" & "*" & "</font>"
         Case 44
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101100 " & "<font color=red>" & "*" & "</font>"
         Case 45
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101101 " & "<font color=red>" & "*" & "</font>"
         Case 46
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101110 " & "<font color=red>" & "*" & "</font>"
         Case 47
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101111 " & "<font color=red>" & "*" & "</font>"
         Case 48
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110000 " & "<font color=red>" & "*" & "</font>"
         Case 49
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110001 " & "<font color=red>" & "*" & "</font>"
         Case 50
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110010 " & "<font color=red>" & "*" & "</font>"
         Case 51
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110011 " & "<font color=red>" & "*" & "</font>"
         Case 52
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110100 " & "<font color=red>" & "*" & "</font>"
         Case 53
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110101 " & "<font color=red>" & "*" & "</font>"
         Case 54
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110110 " & "<font color=red>" & "*" & "</font>"
         Case 55
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110111 " & "<font color=red>" & "*" & "</font>"
         Case 56
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111000 " & "<font color=red>" & "*" & "</font>"
         Case 57
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111001 " & "<font color=red>" & "*" & "</font>"
         Case 58
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111010 " & "<font color=red>" & "*" & "</font>"
         Case 59
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111011 " & "<font color=red>" & "*" & "</font>"
         Case 60
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111100 " & "<font color=red>" & "*" & "</font>"
         Case 61
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111101 " & "<font color=red>" & "*" & "</font>"
         Case 62
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111110 " & "<font color=red>" & "*" & "</font>"
         Case 63
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111111 " & "<font color=red>" & "*" & "</font>"
         Case 64
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000000 " & "<font color=red>" & "*" & "</font>"
         Case 65
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000001 " & "<font color=red>" & "*" & "</font>"
         Case 66
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000010 " & "<font color=red>" & "*" & "</font>"
         Case 67
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000011 " & "<font color=red>" & "*" & "</font>"
         Case 68
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000100 " & "<font color=red>" & "*" & "</font>"
         Case 69
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000101 " & "<font color=red>" & "*" & "</font>"
         Case 70
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000110 " & "<font color=red>" & "*" & "</font>"
         Case 71
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000111 " & "<font color=red>" & "*" & "</font>"
         Case 72
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001000 " & "<font color=red>" & "*" & "</font>"
         Case 73
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001001 " & "<font color=red>" & "*" & "</font>"
         Case 74
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001010 " & "<font color=red>" & "*" & "</font>"
         Case 75
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001011 " & "<font color=red>" & "*" & "</font>"
         Case 76
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001100 " & "<font color=red>" & "*" & "</font>"
         Case 77
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001101 " & "<font color=red>" & "*" & "</font>"
         Case 78
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001110 " & "<font color=red>" & "*" & "</font>"
         Case 79
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001111 " & "<font color=red>" & "*" & "</font>"
         Case 80
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010000 " & "<font color=red>" & "*" & "</font>"
         Case 81
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010001 " & "<font color=red>" & "*" & "</font>"
         Case 82
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010010 " & "<font color=red>" & "*" & "</font>"
         Case 83
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010011 " & "<font color=red>" & "*" & "</font>"
         Case 84
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010100 " & "<font color=red>" & "*" & "</font>"
         Case 85
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010101 " & "<font color=red>" & "*" & "</font>"
         Case 86
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010110 " & "<font color=red>" & "*" & "</font>"
         Case 87
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010111 " & "<font color=red>" & "*" & "</font>"
         Case 88
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011000 " & "<font color=red>" & "*" & "</font>"
         Case 89
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011001 " & "<font color=red>" & "*" & "</font>"
         Case 90
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011010 " & "<font color=red>" & "*" & "</font>"
         End Select
         If ScriptInterrotto Then Exit For
      Next
      Scrivi StringaNumeri(estrazione_lista)
      If ScriptInterrotto Then Exit For
   Next
End Sub

👋🙂

si va bene , ma se si potrebbe fare una leggera modifica

allora, nell'output l'ultima riga :

03.12.71.32.50
* 00000011 *.* 00001100 *.* 01000111 *.* 00100000 *.* 00110010 *


non mi interessa visionare l'estrazione in decimale

ma

il numero indice generale per quella ruota ( Bari 10383 - 174) = 10210 (circa...

un separatore

la data

un separatore

i 5 estratti in BINARIO


10210 * 06/02/2024 * 00000011 *.* 00001100 *.* 01000111 *.* 00100000 *.* 00110010 *
 

lottoLuke

Banned
Se offri rispetto otterrai rispetto se regali considerazione sarai amato, se lasci correre il tuo pensiero sarà accolto.

saluti @BaffoBlù abbiamo inserito anche la possibilità di scegliere altre ruote. il msgbox te lo chiederà.

Sub Main()
Dim continua

Do
Dim ruota
ruota = InputBox("Benvenuto! Inserisci la ruota dell'estrazione: ")

Dim estrazione
Dim estrazione_lista
Dim estrazione_corretta

Do
estrazione = InputBox("Inserisci i numeri dell'estrazione separati da spazi (esempio: 12 18 21 33 35): ")
estrazione_lista = Split(estrazione)

estrazione_corretta = True
Dim numero
For Each numero In estrazione_lista
If Not IsNumeric(numero) Then
estrazione_corretta = False
MsgBox "Errore: Assicurati di inserire solo numeri separati da spazi."
Exit For
End If
Next
Loop While Not estrazione_corretta

Dim numero_indice
numero_indice = calcola_numero_indice(ruota)

Dim data_corrente
data_corrente = Right("0" & Day(Date), 2) & "/" & Right("0" & Month(Date), 2) & "/" & Year(Date)

Dim estrazione_binaria
estrazione_binaria = estrazione_in_binario(estrazione)

If estrazione_binaria <> "" Then
Dim messaggio_finale
messaggio_finale = "Numero indice: " & numero_indice & vbCrLf & _
"Data: " & data_corrente & vbCrLf & _
"Numeri estratti in binario:" & vbCrLf & estrazione_binaria

MsgBox messaggio_finale
End If

' Chiedi all'utente se vuole inserire un'altra ruota
continua = MsgBox("Vuoi inserire un'altra ruota?", vbYesNo) = vbYes
Loop While continua
End Sub

Function estrazione_in_binario(estrazione)
Dim estrazione_binaria
estrazione_binaria = ""
Dim numeri
For Each numeri In Split(estrazione)
Dim numero_int
On Error Resume Next
numero_int = CInt(numeri)
On Error GoTo 0

If Err.Number <> 0 Then
MsgBox "Errore: uno o più numeri non sono validi."
estrazione_in_binario = ""
Exit Function
End If

If numero_int <= 50 Then
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8) & " * "
Else
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8) & " *.* "
End If
Next
estrazione_in_binario = Left(estrazione_binaria, Len(estrazione_binaria) - 3) ' Rimuove gli ultimi 3 caratteri, ovvero lo spazio e il *
End Function

Function Dec2Bin(NumeroDecimale, Lunghezza)
Dim i
Dim Binario
For i = Lunghezza - 1 To 0 Step -1
If NumeroDecimale And (2 ^ i) Then
Binario = Binario & "1"
Else
Binario = Binario & "0"
End If
Next
Dec2Bin = Binario
End Function

Function calcola_numero_indice(ruota)
' In questa funzione si dovrebbe calcolare il numero indice generale per la ruota specificata
' Modifica il calcolo in base alle tue necessità
calcola_numero_indice = 10210 ' Esempio di valore fisso per la demo
End Function
 
Ultima modifica:

lottoLuke

Banned
al volo e poi scappo ecco un ulteriore variazione del codice dove è necessario implementare con un file log.csv nel tuo percorso c: etc
altrimenti non va a ritroso con le ricerche e non cambia data e n estrazione., questo risolve il problema del quale mi sono reso conto.

Codice:
Option Explicit



Dim ultimo_riferimento ' Variabile globale per memorizzare il riferimento numerico dell'ultima estrazione



Sub Main()

    Dim continua

 

    Do

        Dim ruota

        ruota = InputBox("Benvenuto! Inserisci la ruota dell'estrazione: ")

     

        Dim estrazione

        Dim estrazione_lista

        Dim estrazione_corretta

     

        Do

            estrazione = InputBox("Inserisci i numeri dell'estrazione separati da spazi (esempio: 12 18 21 33 35): ")

            estrazione_lista = Split(estrazione)

         

            estrazione_corretta = True

            Dim numero

            For Each numero In estrazione_lista

                If Not IsNumeric(numero) Then

                    estrazione_corretta = False

                    MsgBox "Errore: Assicurati di inserire solo numeri separati da spazi."

                    Exit For

                End If

            Next

        Loop While Not estrazione_corretta

     

        Dim numero_indice

        numero_indice = calcola_numero_indice(ruota)

     

        Dim data_corrente

        data_corrente = Right("0" & Day(Date), 2) & "/" & Right("0" & Month(Date), 2) & "/" & Year(Date)

     

        Dim estrazione_binaria

        estrazione_binaria = estrazione_in_binario(estrazione)

     

        If estrazione_binaria <> "" Then

            Dim messaggio_finale

            messaggio_finale = "Ruota: " & ruota & vbCrLf & _

                              "Riferimento numerico dell'ultima estrazione: " & ultimo_riferimento & vbCrLf & _

                              "Data: " & data_corrente & vbCrLf & _

                              "Numeri estratti in binario:" & vbCrLf & estrazione_binaria

         

            MsgBox messaggio_finale

        End If

     

        ' Scrivi i dettagli dell'estrazione nel file di log

        ScriviLog estrazione, ruota, numero_indice, data_corrente

     

        ' Aggiorna il valore di ultimo_riferimento con il riferimento numerico dell'ultima estrazione

        ultimo_riferimento = numero_indice

     

        ' Chiedi all'utente se vuole inserire un'altra ruota

        continua = MsgBox("Vuoi inserire un'altra ruota?", vbYesNo) = vbYes

    Loop While continua

End Sub



Function estrazione_in_binario(estrazione)

    ' Implementazione della funzione estrazione_in_binario

End Function



Function calcola_numero_indice(ruota)

    ' Implementazione della funzione calcola_numero_indice

End Function



Sub ScriviLog(estrazione, ruota, numero_indice, data_corrente)

    Dim percorso_file

    percorso_file = "C:\percorso\del\tuo\file\log.csv" ' Sostituisci con il percorso del tuo file CSV

 

    Dim fileNum

    fileNum = FreeFile

 

    Open percorso_file For Append As fileNum ' Apre il file CSV in modalità append

 

    ' Scrive i dettagli dell'estratto nel file CSV

    Print #fileNum, numero_indice & "," & ruota & "," & estrazione & "," & data_corrente[/SPOILER]

 

    Close #fileNum ' Chiude il file

End Sub



Main
 
Ultima modifica:

lotto_tom75

Advanced Premium Member
si va bene , ma se si potrebbe fare una leggera modifica

allora, nell'output l'ultima riga :

03.12.71.32.50
* 00000011 *.* 00001100 *.* 01000111 *.* 00100000 *.* 00110010 *


non mi interessa visionare l'estrazione in decimale

ma

il numero indice generale per quella ruota ( Bari 10383 - 174) = 10210 (circa...

un separatore

la data

un separatore

i 5 estratti in BINARIO


10210 * 06/02/2024 * 00000011 *.* 00001100 *.* 01000111 *.* 00100000 *.* 00110010 *

Buongiorno Baffo, guarda se così può andarti bene...

Codice:
Option Explicit
'project by baffoblu
'script by lottotom
Sub Main()
   MsgBox "trasformazione dei numeri delle estrazioni per la ruota voluta in binario."
   Dim ruota
   ruota = ScegliRuota
   Dim estrazione
   ReDim estrazione_lista(0)
   Dim estrazione_corretta
   Dim i
   Dim Inizio
   Dim fine
   Dim quanteultimeestrazioni
   quanteultimeestrazioni = CInt(InputBox("quante ultime estrazioni convertire in binarie?",,100))
   fine = EstrazioneFin
   Inizio = fine - quanteultimeestrazioni
   Dim c
   Dim contaides
   contaides = 0
   Scrivi
   Scrivi NomeRuota(ruota)
   Scrivi
   Scrivi "range temporale 'convertito' " & GetInfoEstrazione(Inizio) & " - " & GetInfoEstrazione(fine)
   Scrivi "numero di ultime estrazioni gestite " & fine - Inizio
   Scrivi
   For i = Inizio To fine
      contaides = contaides + 1
      estrazione = StringaEstratti(i,ruota," ")
      Call SplitByChar(estrazione," ",estrazione_lista)
      'Scrivi StringaNumeri(estrazione_lista)
      '      For c = 0 To UBound(estrazione_lista)
      '         Scrivi "|" & estrazione_lista(c) & "|"
      '         If ScriptInterrotto Then Exit For
      '      Next
      For c = 0 To UBound(estrazione_lista)
         Select Case(estrazione_lista(c))
         Case 1
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000001 " & "<font color=red>" & "*" & "</font>"
         Case 2
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000010 " & "<font color=red>" & "*" & "</font>"
         Case 3
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000011 " & "<font color=red>" & "*" & "</font>"
         Case 4
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000100 " & "<font color=red>" & "*" & "</font>"
         Case 5
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000101 " & "<font color=red>" & "*" & "</font>"
         Case 6
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000110 " & "<font color=red>" & "*" & "</font>"
         Case 7
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000111 " & "<font color=red>" & "*" & "</font>"
         Case 8
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001000 " & "<font color=red>" & "*" & "</font>"
         Case 9
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001001 " & "<font color=red>" & "*" & "</font>"
         Case 10
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001010 " & "<font color=red>" & "*" & "</font>"
         Case 11
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001011 " & "<font color=red>" & "*" & "</font>"
         Case 12
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001100 " & "<font color=red>" & "*" & "</font>"
         Case 13
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001101 " & "<font color=red>" & "*" & "</font>"
         Case 14
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001110 " & "<font color=red>" & "*" & "</font>"
         Case 15
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001111 " & "<font color=red>" & "*" & "</font>"
         Case 16
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010000 " & "<font color=red>" & "*" & "</font>"
         Case 17
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010001 " & "<font color=red>" & "*" & "</font>"
         Case 18
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010010 " & "<font color=red>" & "*" & "</font>"
         Case 19
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010011 " & "<font color=red>" & "*" & "</font>"
         Case 20
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010100 " & "<font color=red>" & "*" & "</font>"
         Case 21
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010101 " & "<font color=red>" & "*" & "</font>"
         Case 22
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010110 " & "<font color=red>" & "*" & "</font>"
         Case 23
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010111 " & "<font color=red>" & "*" & "</font>"
         Case 24
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011000 " & "<font color=red>" & "*" & "</font>"
         Case 25
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011001 " & "<font color=red>" & "*" & "</font>"
         Case 26
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011010 " & "<font color=red>" & "*" & "</font>"
         Case 27
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011011 " & "<font color=red>" & "*" & "</font>"
         Case 28
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011100 " & "<font color=red>" & "*" & "</font>"
         Case 29
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011101 " & "<font color=red>" & "*" & "</font>"
         Case 30
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011110 " & "<font color=red>" & "*" & "</font>"
         Case 31
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011111 " & "<font color=red>" & "*" & "</font>"
         Case 32
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100000 " & "<font color=red>" & "*" & "</font>"
         Case 33
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100001 " & "<font color=red>" & "*" & "</font>"
         Case 34
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100010 " & "<font color=red>" & "*" & "</font>"
         Case 35
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100011 " & "<font color=red>" & "*" & "</font>"
         Case 36
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100100 " & "<font color=red>" & "*" & "</font>"
         Case 37
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100101 " & "<font color=red>" & "*" & "</font>"
         Case 38
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100110 " & "<font color=red>" & "*" & "</font>"
         Case 39
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100111 " & "<font color=red>" & "*" & "</font>"
         Case 40
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101000 " & "<font color=red>" & "*" & "</font>"
         Case 41
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101001 " & "<font color=red>" & "*" & "</font>"
         Case 42
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101010 " & "<font color=red>" & "*" & "</font>"
         Case 43
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101011 " & "<font color=red>" & "*" & "</font>"
         Case 44
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101100 " & "<font color=red>" & "*" & "</font>"
         Case 45
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101101 " & "<font color=red>" & "*" & "</font>"
         Case 46
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101110 " & "<font color=red>" & "*" & "</font>"
         Case 47
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101111 " & "<font color=red>" & "*" & "</font>"
         Case 48
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110000 " & "<font color=red>" & "*" & "</font>"
         Case 49
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110001 " & "<font color=red>" & "*" & "</font>"
         Case 50
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110010 " & "<font color=red>" & "*" & "</font>"
         Case 51
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110011 " & "<font color=red>" & "*" & "</font>"
         Case 52
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110100 " & "<font color=red>" & "*" & "</font>"
         Case 53
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110101 " & "<font color=red>" & "*" & "</font>"
         Case 54
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110110 " & "<font color=red>" & "*" & "</font>"
         Case 55
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110111 " & "<font color=red>" & "*" & "</font>"
         Case 56
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111000 " & "<font color=red>" & "*" & "</font>"
         Case 57
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111001 " & "<font color=red>" & "*" & "</font>"
         Case 58
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111010 " & "<font color=red>" & "*" & "</font>"
         Case 59
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111011 " & "<font color=red>" & "*" & "</font>"
         Case 60
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111100 " & "<font color=red>" & "*" & "</font>"
         Case 61
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111101 " & "<font color=red>" & "*" & "</font>"
         Case 62
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111110 " & "<font color=red>" & "*" & "</font>"
         Case 63
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111111 " & "<font color=red>" & "*" & "</font>"
         Case 64
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000000 " & "<font color=red>" & "*" & "</font>"
         Case 65
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000001 " & "<font color=red>" & "*" & "</font>"
         Case 66
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000010 " & "<font color=red>" & "*" & "</font>"
         Case 67
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000011 " & "<font color=red>" & "*" & "</font>"
         Case 68
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000100 " & "<font color=red>" & "*" & "</font>"
         Case 69
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000101 " & "<font color=red>" & "*" & "</font>"
         Case 70
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000110 " & "<font color=red>" & "*" & "</font>"
         Case 71
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000111 " & "<font color=red>" & "*" & "</font>"
         Case 72
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001000 " & "<font color=red>" & "*" & "</font>"
         Case 73
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001001 " & "<font color=red>" & "*" & "</font>"
         Case 74
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001010 " & "<font color=red>" & "*" & "</font>"
         Case 75
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001011 " & "<font color=red>" & "*" & "</font>"
         Case 76
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001100 " & "<font color=red>" & "*" & "</font>"
         Case 77
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001101 " & "<font color=red>" & "*" & "</font>"
         Case 78
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001110 " & "<font color=red>" & "*" & "</font>"
         Case 79
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001111 " & "<font color=red>" & "*" & "</font>"
         Case 80
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010000 " & "<font color=red>" & "*" & "</font>"
         Case 81
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010001 " & "<font color=red>" & "*" & "</font>"
         Case 82
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010010 " & "<font color=red>" & "*" & "</font>"
         Case 83
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010011 " & "<font color=red>" & "*" & "</font>"
         Case 84
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010100 " & "<font color=red>" & "*" & "</font>"
         Case 85
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010101 " & "<font color=red>" & "*" & "</font>"
         Case 86
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010110 " & "<font color=red>" & "*" & "</font>"
         Case 87
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010111 " & "<font color=red>" & "*" & "</font>"
         Case 88
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011000 " & "<font color=red>" & "*" & "</font>"
         Case 89
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011001 " & "<font color=red>" & "*" & "</font>"
         Case 90
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011010 " & "<font color=red>" & "*" & "</font>"
         End Select
         If ScriptInterrotto Then Exit For
      Next
      Scrivi contaides & " * " & GetInfoEstrazione(i) & " " & StringaNumeri(estrazione_lista)
      If ScriptInterrotto Then Exit For
   Next
End Sub

Per adesso ho lasciato anche il numero progressivo generale e quello del concorso ossia non ho gestito con l'estrapolazione della sola data la stringa presa da getinfoestrazione (es).

:)

x lottoluke : se puoi mettere il codice tra i tag

[
code
]

e

[
/code
]

il tuo interessantissimo code risulterà molto + leggibile ;)

comeinserireilcodicetragliopportunitag.jpg

Un caro saluto a entrambi 👋
 
Ultima modifica:

Master

Advanced Member >PLATINUM<
Un Saluto tutti
Visto la novità ho fatto uno scarabocchio di script ingrandendo i numeri
se non creo disturbo inserisco "salvo errori" la mia soluzione

nel caso lo cancello


Codice:
Option Explicit
Sub Main
   'Tabellone Binario
   Dim Ini,Fin,Es,R,QE,p
   Dim A(5),T(5),Resto(5),Quoz(5),E(5)
   R = CInt(InputBox("SU CHE RUOTA LA RICERCA?",,1))
   QE = CInt(InputBox("DA QUANTE ESTRAZIONI VISUALIZZO?",,100))
   Ini = EstrazioneFin - QE : Fin = EstrazioneFin
   Scrivi Space(2) & "ID" & Space(10) & "Data" & Space(30),1,0,,1,3
   Scrivi " ",0,0
   Scrivi FormatSpace(NomeRuota(R),15),1,0,,1,3
   Scrivi " "
   Scrivi
   For Es = Ini To Fin : AvanzamentoElab Ini,Fin,Es
      Scrivi:Scrivi Es & Space(1) & "**" & Space(1) & DataEstrazione(Es) & Space(1) & "**" & Space(1),0,0,,,3
      For p = 1 To 5
         E(p) = Estratto(Es,R,p)
         A(p) = E(p)
         T(p) = ""
         Do
            Resto(p) = A(p) Mod 2
            Quoz(p) = A(p) \ 2
            A(p) = Quoz(p)
            T(p) = Resto(p) & T(p)
         Loop While Quoz(p) <> 0
         Scrivi FormattaStringa(T(p),"00000000") & Space(1),0,0,,,3
         If p < 5 Then
            Scrivi "*" & Space(1),1,0,,2,3
         End If
      Next
      Scrivi
   Next
End Sub
 

joe

Advanced Member >PLATINUM PLUS<
Un Saluto tutti
Visto la novità ho fatto uno scarabocchio di script ingrandendo i numeri
se non creo disturbo inserisco "salvo errori" la mia soluzione

E' interessante perchè utilizza una soluzione molto simile a quella data dall' I.A.
prima che essa abbia a subire lo stordimento che ... l' homo sa imprimerle.

BRAVO.

L'unica cosa .. gli asterischi rendono difficile separare le varie parti dell' output,
(ci fossero successive laborazioni da eseguire) ma è semplice correggerli fosse necessario.

Forse potrebbe anche essere utile portare a 7 i bit significativi


Bari
10366*08/01/2024*0110000*1010001*1000111*1000011*0010110
10367*09/01/2024*0111101*0110000*1001011*0110110*0000100
10368*11/01/2024*1010111*0001100*1000001*0111010*1011001
10369*12/01/2024*0101110*0100001*1011010*0000010*0011111
10370*13/01/2024*0100101*1000010*1000000*0010000*0001010
10371*16/01/2024*0001100*1010001*0110101*1000001*1011000
10372*18/01/2024*0111101*0010110*0110010*0111010*1000010
10373*19/01/2024*1010110*0101010*0110101*0110111*0111011
10374*20/01/2024*0101111*0011000*1000010*0010011*0011100
10375*23/01/2024*0101001*0010101*0000111*0001010*0110010
10376*25/01/2024*1001000*0100001*0100100*0100000*1010011
10377*26/01/2024*0011111*1001111*0101101*0101000*0111010
10378*27/01/2024*1010001*0100110*0010010*0111100*0111111
10379*30/01/2024*0010101*0110001*1010010*1010001*0011110
10380*01/02/2024*0001111*0001001*0110110*0110011*1010000
10381*02/02/2024*1001111*0001111*0101011*0001000*0111100
10382*03/02/2024*0101010*0111111*0010100*1011010*0101111
10383*06/02/2024*0000011*0001100*1000111*0100000*0110010


:)
 
Ultima modifica:

i legend

Premium Member
Ciao
Personalmente, visto che si conoscono, utilizzerei un array con memorizzati i valori trasformati come stringhe.
A(1)÷"stringa1"
A(2)="stringa2"
.......
A(90)="stringa90"
.......
asep=array("","*","*","*","*","")
For p=1 to 5
E= estratto (id,r,p)
scrivi A(e)&sep,,0
Next
Scrivi
Ciao è solo un esempio,

Non serve calcolare ad ogni estrazione tutto.
Se non si conoscono i numeri si calcolano solo una volta per caricare l array.
Credo sia più veloce, ma bon riesco a provare.





 

Master

Advanced Member >PLATINUM<
Joe ti ringrazio per l'apprezzamento
sì si puo utilizzare 7bit ma ho utilizzato 8 bit perchè così richiesto da BaffoBlu

grazie anche a lotto_tom75 e lottoluke per il pollicione

ora vado a lavorare
Buona giornata
 

BaffoBlù

Advanced Member >GOLD<
Se offri rispetto otterrai rispetto se regali considerazione sarai amato, se lasci correre il tuo pensiero sarà accolto.

saluti @BaffoBlù abbiamo inserito anche la possibilità di scegliere altre ruote. il msgbox te lo chiederà.

Sub Main()
Dim continua

Do
Dim ruota
ruota = InputBox("Benvenuto! Inserisci la ruota dell'estrazione: ")

Dim estrazione
Dim estrazione_lista
Dim estrazione_corretta

Do
estrazione = InputBox("Inserisci i numeri dell'estrazione separati da spazi (esempio: 12 18 21 33 35): ")
estrazione_lista = Split(estrazione)

estrazione_corretta = True
Dim numero
For Each numero In estrazione_lista
If Not IsNumeric(numero) Then
estrazione_corretta = False
MsgBox "Errore: Assicurati di inserire solo numeri separati da spazi."
Exit For
End If
Next
Loop While Not estrazione_corretta

Dim numero_indice
numero_indice = calcola_numero_indice(ruota)

Dim data_corrente
data_corrente = Right("0" & Day(Date), 2) & "/" & Right("0" & Month(Date), 2) & "/" & Year(Date)

Dim estrazione_binaria
estrazione_binaria = estrazione_in_binario(estrazione)

If estrazione_binaria <> "" Then
Dim messaggio_finale
messaggio_finale = "Numero indice: " & numero_indice & vbCrLf & _
"Data: " & data_corrente & vbCrLf & _
"Numeri estratti in binario:" & vbCrLf & estrazione_binaria

MsgBox messaggio_finale
End If

' Chiedi all'utente se vuole inserire un'altra ruota
continua = MsgBox("Vuoi inserire un'altra ruota?", vbYesNo) = vbYes
Loop While continua
End Sub

Function estrazione_in_binario(estrazione)
Dim estrazione_binaria
estrazione_binaria = ""
Dim numeri
For Each numeri In Split(estrazione)
Dim numero_int
On Error Resume Next
numero_int = CInt(numeri)
On Error GoTo 0

If Err.Number <> 0 Then
MsgBox "Errore: uno o più numeri non sono validi."
estrazione_in_binario = ""
Exit Function
End If

If numero_int <= 50 Then
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8) & " * "
Else
estrazione_binaria = estrazione_binaria & Dec2Bin(numero_int, 8) & " *.* "
End If
Next
estrazione_in_binario = Left(estrazione_binaria, Len(estrazione_binaria) - 3) ' Rimuove gli ultimi 3 caratteri, ovvero lo spazio e il *
End Function

Function Dec2Bin(NumeroDecimale, Lunghezza)
Dim i
Dim Binario
For i = Lunghezza - 1 To 0 Step -1
If NumeroDecimale And (2 ^ i) Then
Binario = Binario & "1"
Else
Binario = Binario & "0"
End If
Next
Dec2Bin = Binario
End Function

Function calcola_numero_indice(ruota)
' In questa funzione si dovrebbe calcolare il numero indice generale per la ruota specificata
' Modifica il calcolo in base alle tue necessità
calcola_numero_indice = 10210 ' Esempio di valore fisso per la demo
End Function
va benissimo, c'è solo la limitazione di un estrazione alla volta
 

BaffoBlù

Advanced Member >GOLD<
Buongiorno Baffo, guarda se così può andarti bene...

Codice:
Option Explicit
'project by baffoblu
'script by lottotom
Sub Main()
   MsgBox "trasformazione dei numeri delle estrazioni per la ruota voluta in binario."
   Dim ruota
   ruota = ScegliRuota
   Dim estrazione
   ReDim estrazione_lista(0)
   Dim estrazione_corretta
   Dim i
   Dim Inizio
   Dim fine
   Dim quanteultimeestrazioni
   quanteultimeestrazioni = CInt(InputBox("quante ultime estrazioni convertire in binarie?",,100))
   fine = EstrazioneFin
   Inizio = fine - quanteultimeestrazioni
   Dim c
   Dim contaides
   contaides = 0
   Scrivi
   Scrivi NomeRuota(ruota)
   Scrivi
   Scrivi "range temporale 'convertito' " & GetInfoEstrazione(Inizio) & " - " & GetInfoEstrazione(fine)
   Scrivi "numero di ultime estrazioni gestite " & fine - Inizio
   Scrivi
   For i = Inizio To fine
      contaides = contaides + 1
      estrazione = StringaEstratti(i,ruota," ")
      Call SplitByChar(estrazione," ",estrazione_lista)
      'Scrivi StringaNumeri(estrazione_lista)
      '      For c = 0 To UBound(estrazione_lista)
      '         Scrivi "|" & estrazione_lista(c) & "|"
      '         If ScriptInterrotto Then Exit For
      '      Next
      For c = 0 To UBound(estrazione_lista)
         Select Case(estrazione_lista(c))
         Case 1
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000001 " & "<font color=red>" & "*" & "</font>"
         Case 2
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000010 " & "<font color=red>" & "*" & "</font>"
         Case 3
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000011 " & "<font color=red>" & "*" & "</font>"
         Case 4
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000100 " & "<font color=red>" & "*" & "</font>"
         Case 5
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000101 " & "<font color=red>" & "*" & "</font>"
         Case 6
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000110 " & "<font color=red>" & "*" & "</font>"
         Case 7
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00000111 " & "<font color=red>" & "*" & "</font>"
         Case 8
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001000 " & "<font color=red>" & "*" & "</font>"
         Case 9
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001001 " & "<font color=red>" & "*" & "</font>"
         Case 10
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001010 " & "<font color=red>" & "*" & "</font>"
         Case 11
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001011 " & "<font color=red>" & "*" & "</font>"
         Case 12
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001100 " & "<font color=red>" & "*" & "</font>"
         Case 13
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001101 " & "<font color=red>" & "*" & "</font>"
         Case 14
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001110 " & "<font color=red>" & "*" & "</font>"
         Case 15
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00001111 " & "<font color=red>" & "*" & "</font>"
         Case 16
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010000 " & "<font color=red>" & "*" & "</font>"
         Case 17
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010001 " & "<font color=red>" & "*" & "</font>"
         Case 18
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010010 " & "<font color=red>" & "*" & "</font>"
         Case 19
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010011 " & "<font color=red>" & "*" & "</font>"
         Case 20
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010100 " & "<font color=red>" & "*" & "</font>"
         Case 21
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010101 " & "<font color=red>" & "*" & "</font>"
         Case 22
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010110 " & "<font color=red>" & "*" & "</font>"
         Case 23
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00010111 " & "<font color=red>" & "*" & "</font>"
         Case 24
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011000 " & "<font color=red>" & "*" & "</font>"
         Case 25
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011001 " & "<font color=red>" & "*" & "</font>"
         Case 26
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011010 " & "<font color=red>" & "*" & "</font>"
         Case 27
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011011 " & "<font color=red>" & "*" & "</font>"
         Case 28
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011100 " & "<font color=red>" & "*" & "</font>"
         Case 29
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011101 " & "<font color=red>" & "*" & "</font>"
         Case 30
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011110 " & "<font color=red>" & "*" & "</font>"
         Case 31
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00011111 " & "<font color=red>" & "*" & "</font>"
         Case 32
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100000 " & "<font color=red>" & "*" & "</font>"
         Case 33
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100001 " & "<font color=red>" & "*" & "</font>"
         Case 34
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100010 " & "<font color=red>" & "*" & "</font>"
         Case 35
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100011 " & "<font color=red>" & "*" & "</font>"
         Case 36
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100100 " & "<font color=red>" & "*" & "</font>"
         Case 37
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100101 " & "<font color=red>" & "*" & "</font>"
         Case 38
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100110 " & "<font color=red>" & "*" & "</font>"
         Case 39
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00100111 " & "<font color=red>" & "*" & "</font>"
         Case 40
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101000 " & "<font color=red>" & "*" & "</font>"
         Case 41
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101001 " & "<font color=red>" & "*" & "</font>"
         Case 42
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101010 " & "<font color=red>" & "*" & "</font>"
         Case 43
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101011 " & "<font color=red>" & "*" & "</font>"
         Case 44
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101100 " & "<font color=red>" & "*" & "</font>"
         Case 45
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101101 " & "<font color=red>" & "*" & "</font>"
         Case 46
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101110 " & "<font color=red>" & "*" & "</font>"
         Case 47
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00101111 " & "<font color=red>" & "*" & "</font>"
         Case 48
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110000 " & "<font color=red>" & "*" & "</font>"
         Case 49
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110001 " & "<font color=red>" & "*" & "</font>"
         Case 50
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110010 " & "<font color=red>" & "*" & "</font>"
         Case 51
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110011 " & "<font color=red>" & "*" & "</font>"
         Case 52
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110100 " & "<font color=red>" & "*" & "</font>"
         Case 53
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110101 " & "<font color=red>" & "*" & "</font>"
         Case 54
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110110 " & "<font color=red>" & "*" & "</font>"
         Case 55
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00110111 " & "<font color=red>" & "*" & "</font>"
         Case 56
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111000 " & "<font color=red>" & "*" & "</font>"
         Case 57
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111001 " & "<font color=red>" & "*" & "</font>"
         Case 58
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111010 " & "<font color=red>" & "*" & "</font>"
         Case 59
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111011 " & "<font color=red>" & "*" & "</font>"
         Case 60
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111100 " & "<font color=red>" & "*" & "</font>"
         Case 61
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111101 " & "<font color=red>" & "*" & "</font>"
         Case 62
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111110 " & "<font color=red>" & "*" & "</font>"
         Case 63
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 00111111 " & "<font color=red>" & "*" & "</font>"
         Case 64
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000000 " & "<font color=red>" & "*" & "</font>"
         Case 65
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000001 " & "<font color=red>" & "*" & "</font>"
         Case 66
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000010 " & "<font color=red>" & "*" & "</font>"
         Case 67
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000011 " & "<font color=red>" & "*" & "</font>"
         Case 68
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000100 " & "<font color=red>" & "*" & "</font>"
         Case 69
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000101 " & "<font color=red>" & "*" & "</font>"
         Case 70
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000110 " & "<font color=red>" & "*" & "</font>"
         Case 71
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01000111 " & "<font color=red>" & "*" & "</font>"
         Case 72
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001000 " & "<font color=red>" & "*" & "</font>"
         Case 73
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001001 " & "<font color=red>" & "*" & "</font>"
         Case 74
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001010 " & "<font color=red>" & "*" & "</font>"
         Case 75
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001011 " & "<font color=red>" & "*" & "</font>"
         Case 76
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001100 " & "<font color=red>" & "*" & "</font>"
         Case 77
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001101 " & "<font color=red>" & "*" & "</font>"
         Case 78
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001110 " & "<font color=red>" & "*" & "</font>"
         Case 79
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01001111 " & "<font color=red>" & "*" & "</font>"
         Case 80
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010000 " & "<font color=red>" & "*" & "</font>"
         Case 81
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010001 " & "<font color=red>" & "*" & "</font>"
         Case 82
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010010 " & "<font color=red>" & "*" & "</font>"
         Case 83
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010011 " & "<font color=red>" & "*" & "</font>"
         Case 84
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010100 " & "<font color=red>" & "*" & "</font>"
         Case 85
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010101 " & "<font color=red>" & "*" & "</font>"
         Case 86
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010110 " & "<font color=red>" & "*" & "</font>"
         Case 87
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01010111 " & "<font color=red>" & "*" & "</font>"
         Case 88
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011000 " & "<font color=red>" & "*" & "</font>"
         Case 89
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011001 " & "<font color=red>" & "*" & "</font>"
         Case 90
            estrazione_lista(c) = "<font color=red>" & "*" & "</font>" & " 01011010 " & "<font color=red>" & "*" & "</font>"
         End Select
         If ScriptInterrotto Then Exit For
      Next
      Scrivi contaides & " * " & GetInfoEstrazione(i) & " " & StringaNumeri(estrazione_lista)
      If ScriptInterrotto Then Exit For
   Next
End Sub

Per adesso ho lasciato anche il numero progressivo generale e quello del concorso ossia non ho gestito con l'estrapolazione della sola data la stringa presa da getinfoestrazione (es).

:)

x lottoluke : se puoi mettere il codice tra i tag

[
code
]

e

[
/code
]

il tuo interessantissimo code risulterà molto + leggibile ;)

Vedi l'allegato 2277845

Un caro saluto a entrambi 👋
certo così va più che bene

ma fra un po' approfitto per scrivere altro...
 

BaffoBlù

Advanced Member >GOLD<
Un Saluto tutti
Visto la novità ho fatto uno scarabocchio di script ingrandendo i numeri
se non creo disturbo inserisco "salvo errori" la mia soluzione

nel caso lo cancello


Codice:
Option Explicit
Sub Main
   'Tabellone Binario
   Dim Ini,Fin,Es,R,QE,p
   Dim A(5),T(5),Resto(5),Quoz(5),E(5)
   R = CInt(InputBox("SU CHE RUOTA LA RICERCA?",,1))
   QE = CInt(InputBox("DA QUANTE ESTRAZIONI VISUALIZZO?",,100))
   Ini = EstrazioneFin - QE : Fin = EstrazioneFin
   Scrivi Space(2) & "ID" & Space(10) & "Data" & Space(30),1,0,,1,3
   Scrivi " ",0,0
   Scrivi FormatSpace(NomeRuota(R),15),1,0,,1,3
   Scrivi " "
   Scrivi
   For Es = Ini To Fin : AvanzamentoElab Ini,Fin,Es
      Scrivi:Scrivi Es & Space(1) & "**" & Space(1) & DataEstrazione(Es) & Space(1) & "**" & Space(1),0,0,,,3
      For p = 1 To 5
         E(p) = Estratto(Es,R,p)
         A(p) = E(p)
         T(p) = ""
         Do
            Resto(p) = A(p) Mod 2
            Quoz(p) = A(p) \ 2
            A(p) = Quoz(p)
            T(p) = Resto(p) & T(p)
         Loop While Quoz(p) <> 0
         Scrivi FormattaStringa(T(p),"00000000") & Space(1),0,0,,,3
         If p < 5 Then
            Scrivi "*" & Space(1),1,0,,2,3
         End If
      Next
      Scrivi
   Next
End Sub
ECCOLO!

ha fatto uno scarabocchio dice modestamente lui...

ecco quello che dicevo quando ho alluso al calcolo della divisione per 2 e resto zero...
aggiunsi la tabella per non creare dubbi.

Master, il tuo nick e il tuo script parlano per te.

Ragazzi, l'algoritmo un po' più giusto è questo!

E' quello che avrei tentato di fare io se mannaggia me ci vedevo meglio...

Gira in un battibaleno...

bravo Master
 

BaffoBlù

Advanced Member >GOLD<
E' interessante perchè utilizza una soluzione molto simile a quella data dall' I.A.
prima che essa abbia a subire lo stordimento che ... l' homo sa imprimerle.

BRAVO.

L'unica cosa .. gli asterischi rendono difficile separare le varie parti dell' output,
(ci fossero successive laborazioni da eseguire) ma è semplice correggerli fosse necessario.

Forse potrebbe anche essere utile portare a 7 i bit significativi


Bari
10366*08/01/2024*0110000*1010001*1000111*1000011*0010110
10367*09/01/2024*0111101*0110000*1001011*0110110*0000100
10368*11/01/2024*1010111*0001100*1000001*0111010*1011001
10369*12/01/2024*0101110*0100001*1011010*0000010*0011111
10370*13/01/2024*0100101*1000010*1000000*0010000*0001010
10371*16/01/2024*0001100*1010001*0110101*1000001*1011000
10372*18/01/2024*0111101*0010110*0110010*0111010*1000010
10373*19/01/2024*1010110*0101010*0110101*0110111*0111011
10374*20/01/2024*0101111*0011000*1000010*0010011*0011100
10375*23/01/2024*0101001*0010101*0000111*0001010*0110010
10376*25/01/2024*1001000*0100001*0100100*0100000*1010011
10377*26/01/2024*0011111*1001111*0101101*0101000*0111010
10378*27/01/2024*1010001*0100110*0010010*0111100*0111111
10379*30/01/2024*0010101*0110001*1010010*1010001*0011110
10380*01/02/2024*0001111*0001001*0110110*0110011*1010000
10381*02/02/2024*1001111*0001111*0101011*0001000*0111100
10382*03/02/2024*0101010*0111111*0010100*1011010*0101111
10383*06/02/2024*0000011*0001100*1000111*0100000*0110010


:)
ok, ma mi servono 8 bit
 

Ultima estrazione Lotto

  • Estrazione del lotto
    sabato 27 aprile 2024
    Bari
    02
    74
    34
    72
    78
    Cagliari
    60
    62
    43
    58
    38
    Firenze
    88
    70
    85
    38
    50
    Genova
    18
    61
    70
    08
    80
    Milano
    85
    81
    16
    03
    26
    Napoli
    34
    31
    01
    41
    51
    Palermo
    52
    59
    54
    35
    05
    Roma
    34
    83
    23
    67
    61
    Torino
    86
    59
    61
    62
    48
    Venezia
    69
    50
    40
    05
    79
    Nazionale
    31
    30
    85
    45
    67
    Estrazione Simbolotto
    Genova
    37
    02
    21
    34
    13
Alto