/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        $repeat = $paramArr[0];
        for ($i = 1; $i < 101; $i++) {
            $halfNum = $i / 100;
            for ($j = 4; $j < 29; $j++) {
                $ogListArr = getRandOgList(1, 29, $j, $repeat);
                $total = 0;
                foreach ($ogListArr as $ogList) {
                    $statics = execute($ogList, $halfNum);
                    $total += $statics['count'];
                }
                $avgNumber = $total / $repeat;
                echo $avgNumber;
                if ($j < 28) {
                    echo ',';
                }
            }
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}
/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        $repeat = $paramArr[2];
        for ($i = 4; $i < 30; $i++) {
            $ogListArr = getRandOgList(1, 29, $i, $repeat);
            $total1 = 0;
            $total2 = 0;
            foreach ($ogListArr as $ogList) {
                echo json_encode($ogList);
                echo '<br>';
                $statics = execute($ogList, $paramArr[0], $paramArr[1]);
                $total1 += $statics[0]['count'];
                $total2 += $statics[1]['count'];
            }
            $avg1 = $total1 / $repeat;
            $avg2 = $total2 / $repeat;
            echo '1/2 --- ' . (string) $avg1 . '<br>';
            echo '1   --- ' . (string) $avg2 . '<br>';
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}
Beispiel #3
0
/**
 * Init function of API.
 */
function init()
{
    if (($idArr = parseParam()) && validateParam($idArr)) {
        execute($idArr);
    } else {
        printParamErr();
    }
}
Beispiel #4
0
/**
 * Init function of API.
 */
function init()
{
    if (($paramArr = getParam()) && validateParam($paramArr[0]) && validateParam($paramArr[1])) {
        execute($paramArr[0], $paramArr[1], $paramArr[2]);
    } else {
        printParamErr();
    }
}
Beispiel #5
0
/**
 * Init function of API.
 */
function init()
{
    if (($idArrGroup = parseParam()) && validateParam($idArrGroup[0]) && validateParam($idArrGroup[1])) {
        execute($idArrGroup);
    } else {
        printParamErr();
    }
}
Beispiel #6
0
/**
 * Init function of API.
 */
function init()
{
    if (($paramArr = getParam()) && validateParam($paramArr[0]) && validateParam($paramArr[1])) {
        echo json_encode($paramArr[0]);
        echo '<br>';
        echo json_encode($paramArr[1]);
        echo '<br>';
        execute($paramArr[0], $paramArr[1], $paramArr[2]);
        echo '----1<br>';
        execute($paramArr[0], $paramArr[1], $paramArr[3]);
        echo '----1/2<br>';
    } else {
        printParamErr();
    }
}
/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        for ($i = 0; $i < 29; $i++) {
            $paramArr[0] = $paramArr[1];
            array_splice($paramArr[0], $i, 1);
            echo json_encode($paramArr[0]);
            echo '<br>';
            echo json_encode($paramArr[1]);
            echo '<br>';
            execute($paramArr[0], $paramArr[1], $paramArr[2]);
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}