renewd grapper wip
This commit is contained in:
1 parent
8f1aeafe46
commit
4afe60a957
55 files changed
+1389
-823
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
||||
|
||||
class ActiveHandicap
|
||||
{
|
||||
public static function set(&$_spreads)
|
||||
{
|
||||
$tmp = 10000;
|
||||
$hcap = false;
|
||||
foreach ($_spreads as $key => $value) {
|
||||
$x = 0;
|
||||
foreach ($value as $k => $v) {
|
||||
if ($x == 0) {
|
||||
$x = $v;
|
||||
} else {
|
||||
$x -= $v;
|
||||
}
|
||||
}
|
||||
$x = abs($x);
|
||||
if ($x < $tmp) {
|
||||
$hcap = $key;
|
||||
$tmp = $x;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_spreads as $key => $value) {
|
||||
if ($key == $hcap) {
|
||||
$_spreads[$key]['active_spread'] = 1;
|
||||
} else {
|
||||
$_spreads[$key]['active_spread'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user