Skip to content

Instantly share code, notes, and snippets.

@denisdemaisbr
Created January 3, 2025 12:49
Show Gist options
  • Save denisdemaisbr/0dec173673eb74c82c1b31d94d933d22 to your computer and use it in GitHub Desktop.
Save denisdemaisbr/0dec173673eb74c82c1b31d94d933d22 to your computer and use it in GitHub Desktop.
loterias caixa, bolao, 'pega detalhe zuado e converte pra usavel em outros programas, finalidades'
Nome Loteria: XXX
Cidade/UF: xxx - XX
Valor da Cota: R$ 1,99
Tarifa de Serviço: R$ 1,99
Números selecionados
Jogo 1
01
04
05
09
11
14
19
20
23
29
37
39
47
49
<?php
/*
///
https://unlicense.org/
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org/>
///
apenas para uso educacional, sem garantia.
jogo eh para maiores de 18 anos.
///
quando copia o bolao da caixa vem todo zuado, entao, deixa bunitinho pra usar para outras finalidades.
suporta varios boloes.
/// output
$ php main.php | cut -c 6-
01 04 05 09 11 14 19 20 23 29 37 39 47 49
$ php main.php
[14] 01 04 05 09 11 14 19 20 23 29 37 39 47 49
xxxx yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
x = quantidade de dezenas
y = dezenas
///
denis dos santos silva, 2025-01-03
*/
$r = [];
$inline = false;
$debug = false;
$source = "aposta.txt";
$sep = " ";
if (count($argv) > 1)
$source = $argv[1];
$handle = fopen($source, "r");
if (!$handle)
die("cant open file");
while (($line = fgets($handle)) !== false) {
$line = trim($line);
if ( strlen($line) == 0 )
continue;
if ( preg_match('/^Jogo \d+$/', $line) ) {
jogo:
if ($debug)
echo "$line\n";
$r = [];
while ( ($l = fgets($handle)) || $inline ) {
$inline = false;
$l = trim($l);
if (strlen($l) == 0)
break;
if ( preg_match('/^Jogo \d+$/', $l) ) {
// goto?
$inline = true;
break;
}
$l = (int) $l;
if ($l > 0 and $l < 99) {
$r[] = sprintf("%02d", $l);
}
}
if (count($r) > 5)
printf("[%02d] %s\n", count($r), implode($sep, $r));
}
}
fclose($handle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment