2
Guys, I need your help if possible... I have created a game generation system in Otofácil, based on another system... Well my system is not very complex... the user chooses 5 dozens/numbers to delete from his games, and the generator generates 356 different combinations...
So far so good, I managed to make the code that generates all possible combinations in the sequence of 20 numbers, making combinations of 15... and I show to the user 356 of the more than 15 thousand combinations...
My system compares the numbers with the last game, and tells how many points and real (R$) the user would have made with those games...
The problem is that in the other system, the combinations that are "generated" when you exclude the 5 numbers, always gives at least 1 result of 14 hits and mine not, because you exclude 5 numbers that did not come out in the last contest...
//Primeiras Impressões do Sistema Excluindo as Dezenas: 02 03 05 08 09
1 4 4 6 7 10 11 12 13 14 15 16 18 22 23
1 4 4 6 7 10 11 12 13 14 15 18 19 20 21
1 4 4 6 7 10 11 12 13 14 16 18 19 22 24
1 4 4 6 7 10 11 12 13 14 17 18 19 23 24
1 4 4 6 7 10 11 12 13 15 16 17 18 22 23
1 4 4 6 7 10 11 12 13 15 16 18 20 21 22
1 4 4 6 7 10 11 12 13 15 16 20 21 22 23
1 4 4 6 7 10 11 12 13 15 17 18 20 21 24
1 4 4 6 7 10 11 12 13 16 17 20 22 23 24
1 4 4 6 7 10 11 12 13 16 18 21 22 23 24
1 4 4 6 7 10 11 12 14 15 16 17 19 20 23
These are the first 11, but I can see they’re very different from mine:
//Primeiras Impressões do Meu Sistema Excluindo as Dezenas: $exclusao=["02","03","05","08","09"];
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 20 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 21 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 22 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 23 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 24 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 19 [14] => 25 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 20 [14] => 21 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 20 [14] => 22 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 20 [14] => 23 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 20 [14] => 24 )
Array ( [0] => 01 [1] => 04 [2] => 06 [3] => 07 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => 15 [10] => 16 [11] => 17 [12] => 18 [13] => 20 [14] => 25 )
My generation code is this:
$dezenas =array_diff($numeros,$exclusao);
sort($dezenas);
function combinacoesDe($k, $xs){
if ($k === 0)
return array(array());
if (count($xs) === 0)
return array();
$x = $xs[0];
$xs1 = array_slice($xs,1,count($xs)-1);
$res1 = combinacoesDe($k-1,$xs1);
for ($i = 0; $i < count($res1); $i++) {
array_splice($res1[$i], 0, 0, $x);
}
$res2 = combinacoesDe($k,$xs1);
return array_merge($res1, $res2);
}
$resultado = combinacoesDe(15,$dezenas);
And the print and compare is this:
<?php $numaposta=1;
for($z =1 ; $z <= 356 ; $z++) {
echo "<div class='mostra-aposta'>";
echo"<h4 style=''>Aposta $numaposta </h4>";
$numaposta=$numaposta+1;
for($x = 1 ; $x <= 25 ; $x++) { ?>
<span <?php if(in_array($x,$resultado[$z])!== FALSE){echo"class='ok'";}elseif(in_array($x,$exclusao)!== FALSE){echo"class='ok2'";}else{} ?>><?php echo"$x"; ?></span>
<?php
}
$quantos = array_intersect($dezenasr, $resultado[$z]);
$premio = count($quantos);
if($premio===15){
array_push($a15, $z);
}elseif($premio===14){
array_push($a14, $z);
}elseif($premio===13){
array_push($a13, $z);
}elseif($premio===12){
array_push($a12, $z);
}elseif($premio===11){
array_push($a11, $z);
}
echo "</div>";
}
$puxarht=ob_get_contents();
$htb64=base64_encode($puxarht);
ob_end_flush();
$n15=count($a15);
$n14=count($a14);
$n13=count($a13);
$n12=count($a12);
$n11=count($a11);
$premio15=$quinze -> valor_pago * $n15;
$premio14=$quatorze -> valor_pago * $n14;
$premio14=str_replace(".","",$premio14);
$premio13=$treze -> valor_pago * $n13;
$premio12=$doze -> valor_pago * $n12;
$premio11=$onze -> valor_pago * $n11;
$premiototal=$premio15+$premio14+$premio13+$premio12+$premio11;
$totaldeacertos=$n11+$n12+$n13+$n14+$n15;
?>
I’ve already made the comparison and all the sequences generated in their system are among my more than 15,000 combinations... the problem is that far apart from each other... I’d appreciate it if you could help me with that, thank you!
I couldn’t understand what you want. I also developed something similar http://kithomepage.com/arrayCombLotofacil.php
– user60252