Jump to content

Lotomania com 04 ou 05 acertos dentre as 50 dezenas. Você consegue fazer isso???


Elétron

Recommended Posts

Function RandLatin(Optional bVolatile As Boolean = False) As Long()
  ' shg 2013

  ' UDF only
  ' Requires aiRandLong()

  ' Returns a random Latin square of size n with symbols 1 to n
  ' (by shuffling the symbols, then the rows, then the columns)
  ' to the calling range

  ' e.g., in A1:E5, {=RandLatin()}

  ' All such squares generated in this fashion are members (I think)
  ' of the same isotopy class, so it doesn't generate all possibilities.

  Dim aiInp()       As Long
  Dim aiOut()       As Long
  Dim aiRnd()       As Long
  Dim n             As Long
  Dim i             As Long
  Dim j             As Long

  If bVolatile Then Application.Volatile

  With Application.Caller
    n = IIf(.Rows.Count > .Columns.Count, .Rows.Count, .Columns.Count)
  End With

  ReDim aiInp(1 To n, 1 To n)
  ReDim aiOut(1 To n, 1 To n)

  ' shuffle the symbols
  aiRnd = aiRandLong(1, n)
  For i = 1 To n
    For j = 1 To n
      aiInp(i, j) = aiRnd(((i + j - 2) Mod n) + 1)
    Next j
  Next i

  ' shuffle the rows
  aiRnd = aiRandLong(1, n)
  For i = 1 To n
    For j = 1 To n
      aiOut(i, j) = aiInp(aiRnd(i), j)
    Next j
  Next i

  aiInp = aiOut

  ' shuffle the columns
  aiRnd = aiRandLong(1, n)
  For i = 1 To n
    For j = 1 To n
      aiOut(j, i) = aiInp(j, aiRnd(i))
    Next j
  Next i

  RandLatin = aiOut
End Function

Public Function aiRandLong(iMin As Long, _
                           iMax As Long, _
                           Optional ByVal n As Long = -1, _
                           Optional bVolatile As Boolean = False) As Long()
  ' shg 2008
  ' UDF or VBA

  ' Returns a 1-based array of n unique Longs between iMin and iMax inclusive
  ' Requires FYShuffle

  Dim ai()          As Long     ' array of numbers iMin to iMax
  Dim i             As Long     ' index to ai

  If bVolatile Then Application.Volatile True

  If n < 0 Then n = iMax - iMin + 1
  If iMin > iMax Or n > (iMax - iMin + 1) Or n < 1 Then Exit Function

  ReDim ai(iMin To iMax)

  For i = iMin To iMax
    ai(i) = i
  Next i

  FYShuffle ai
  If n > -1 Then ReDim Preserve ai(iMin To iMin + n - 1)
  aiRandLong = ai
End Function

Sub FYShuffle(av As Variant)
  ' shg 2015
  
  ' In-situ Fisher-Yates shuffle of 1D array av
  ' VBA only

  Dim iLB           As Long
  Dim iTop          As Long
  Dim vTmp          As Variant
  Dim iRnd          As Long

  iLB = LBound(av)
  iTop = UBound(av) - iLB + 1

  Do While iTop
    iRnd = Int(Rnd * iTop)
    iTop = iTop - 1
    vTmp = av(iTop + iLB)
    av(iTop + iLB) = av(iRnd + iLB)
    av(iRnd + iLB) = vTmp
  Loop
End Sub
Link to comment
Share on other sites

pessoal se conseguir 10 11 ou  12 pts em 40 dz Obsnao sei se e 100%  talves alguem ja tenha feito ele aqui no forum não sei.   se já  desconsiderem.   falta testar mas e muito promisor.  + ou - 50 grupos de 40  esta dentro do previsto ou nao??     é q eu tento fazer a unha. nao com  programas entende usando par e impares.  

Link to comment
Share on other sites

ja existe sim e até com menas q as minhas ok.   desconsiderem ai ok.é do amigo 

 

 

 

Luicke

  • Membro Avançado
  •  
  • Luicke
  • Membro
  •  133
  • 637 posts

Alo galera !!

Estou estudando a lotomania há pouco tempo, consegui formar 2 grupos de 10 jogos (com 40 dezenas) o 1º grupo é baseado em dezenas ímpares e o segundo em dezenas pares, testei estes jogos desde o concurso 1239 (2 vezes 15 pontos e várias com 12 e 13 pontos), conseguir 12, 13 e 15 pontos em 40 dezenas é bastante promissor, vou continuar estudando e tentar diminuir a quantidade de jogos, peço que testem e opinem......

Grupo 1

1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 13; 15; 17; 19; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 33; 35; 37; 39; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50

6; 7; 8; 9; 10; 11; 13; 15; 17; 19; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 33; 35; 37; 39; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 53; 55; 57; 59

11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 23; 25; 27; 29; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 43; 45; 47; 49; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60

16; 17; 18; 19; 20; 21; 23; 25; 27; 29; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 43; 45; 47; 49; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 63; 65; 67; 69

21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 33; 35; 37; 39; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 53; 55; 57; 59; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70

1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 13; 15; 17; 19; 21; 22; 23; 24; 25; 51; 53; 55; 57; 59; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 73; 75; 77; 79

6; 7; 8; 9; 10; 11; 13; 15; 17; 19; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 56; 57; 58; 59; 60; 61; 63; 65; 67; 69; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80

11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 23; 25; 27; 29; 31; 32; 33; 34; 35; 61; 63; 65; 67; 69; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 83; 85; 87; 89

16; 17; 18; 19; 20; 21; 23; 25; 27; 29; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 66; 67; 68; 69; 70; 71; 73; 75; 77; 79; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90

21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 33; 35; 37; 39; 41; 42; 43; 44; 45; 71; 73; 75; 77; 79; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 93; 95; 97; 99

 

 
Grupo 2

1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 12; 14; 16; 18; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 32; 34; 36; 38; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50

6; 7; 8; 9; 10; 12; 14; 16; 18; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 32; 34; 36; 38; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 52; 54; 56; 58; 60

11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 22; 24; 26; 28; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 42; 44; 46; 48; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60

16; 17; 18; 19; 20; 22; 24; 26; 28; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 42; 44; 46; 48; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 62; 64; 66; 68; 70

21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 32; 34; 36; 38; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 52; 54; 56; 58; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70

1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 12; 14; 16; 18; 20; 21; 22; 23; 24; 25; 52; 54; 56; 58; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 72; 74; 76; 78; 80

6; 7; 8; 9; 10; 12; 14; 16; 18; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 56; 57; 58; 59; 60; 62; 64; 66; 68; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80

11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 22; 24; 26; 28; 30; 31; 32; 33; 34; 35; 62; 64; 66; 68; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 82; 84; 86; 88; 90

16; 17; 18; 19; 20; 22; 24; 26; 28; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 66; 67; 68; 69; 70; 72; 74; 76; 78; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90

21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 32; 34; 36; 38; 40; 41; 42; 43; 44; 45; 72; 74; 76; 78; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 92; 94; 96; 98; 100

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...