2

我正在制作纸牌游戏,我需要事先创建纸牌并将它们存储在 mysql 表中。我试图弄清楚如何制作一个 php 脚本来创建它们。嗯,有 6 个类别的值从 0 到 12 不等,每张卡都有每个类别的值。每张卡片中类别值的总和必须是 36。所以每张卡片是这样的:

  • 6 - 9 - 2 - 10 - 6 - 3

或者

  • 0 - 12 - 0 - 12 - 0 - 12

甚至

  • 6 - 6 - 6 - 6 - 6 - 6

我想如果我能随机生成 50 或 60 张卡片,那就太棒了。

提前致谢。

4

3 回答 3

5

像这样的东西应该可以工作-逻辑可能有点不对劲,我还没有测试过。

function generate_card() {
    $max_card = 12;  // What's the highest value of a card number?
    $min_card = 0;   // What's the lowest value of a card number?
    $num_cards = 6;  // How many numbers on a card?
    $total = 36;     // What's the desired sum?
    $numbers = array();
    $running_total = 0;
    for ($i = 0; $i < $num_cards; ++$i) {
        $max = min($max_card, $total - $running_total); //The highest number we can choose
        $min = max($min_card, $total - $running_total - ($max_card * ($num_cards - ($i + 1)))); //The lowest number we can choose

        //- how much is left ? $total - $running total
        //- min is amount_left - ($max_card

        $number = rand($min, $max);
        $running_total += $number;
        $numbers[] = $number;
    }

    return $numbers;
}

编辑:我放错了括号和索引,它现在可以正常工作。

于 2012-07-10T22:46:59.193 回答
2

一个非常天真的方法是:

/* return an array of 6 numbers between 0 and 12 that sum to 36 */
generate_card() {
    $numbers = array();
    for($i = 0; $i < 6; $i += 1) {
        $numbers[$i] = rand(0, 12);
    }
    if (array_sum($numbers) !== 36) {
        return generate_card(); // repeat until we find one that does sum to 36
    } else {
        return $numbers; // yay!
    }
}

我认为这对于“简单的纸牌游戏”来说已经足够好了。

于 2012-07-10T22:38:50.013 回答
0

我知道您已经为此选择了答案,但我认为无论如何我都会考虑我的解决方案,因为我认为它带来了一些东西。

部分问题在于“随机手”的含义在这里有点模糊。如果你想要一手真正随机的 6 张牌,总和为 36,你必须有平等的机会从所有可能的手牌中挑选总和为 36 的牌。

可以对数字求和的方式称为分区。我编写了一个算法来生成 36 个所有可能的分区。那是一万七千多个分区。然后我淘汰了任何使用超过 12 个数字的分区,然后我淘汰了任何涉及超过 6 个数字的分区。这给我留下了 676 手可能的 6 张牌,总和为 36。

为了确保完全随机性,我将采取的方法是从所有可能的手牌中随机挑选。它的存储密集度更高(您必须存储数组),但比建议的任何方法都快得多(因为您只选择一个随机数,然后将其从数组中取出)。这是缩写代码(后面有完整代码):

$allHands = array(
    array(12,12,12,0,0,0),
    array(12,12,11,1,0,0),
    array(12,12,10,2,0,0),
    array(12,12,10,1,1,0),
    // ...etc
);
$hand = $allHands[ rand( 0, count($allHands)-1 ) ];
shuffle( $hand );
// $hand is now a completely random hand of 6 cards summing to 36

这是所有可能的牌的完整数组:

$allHands = array(
    array( 12, 12, 12, 0, 0, 0 ),
    array( 12, 12, 11, 1, 0, 0 ),
    array( 12, 12, 10, 2, 0, 0 ),
    array( 12, 12, 10, 1, 1, 0 ),
    array( 12, 12, 9, 3, 0, 0 ),
    array( 12, 12, 9, 2, 1, 0 ),
    array( 12, 12, 9, 1, 1, 1 ),
    array( 12, 12, 8, 4, 0, 0 ),
    array( 12, 12, 8, 3, 1, 0 ),
    array( 12, 12, 8, 2, 2, 0 ),
    array( 12, 12, 8, 2, 1, 1 ),
    array( 12, 12, 7, 5, 0, 0 ),
    array( 12, 12, 7, 4, 1, 0 ),
    array( 12, 12, 7, 3, 2, 0 ),
    array( 12, 12, 7, 3, 1, 1 ),
    array( 12, 12, 7, 2, 2, 1 ),
    array( 12, 12, 6, 6, 0, 0 ),
    array( 12, 12, 6, 5, 1, 0 ),
    array( 12, 12, 6, 4, 2, 0 ),
    array( 12, 12, 6, 4, 1, 1 ),
    array( 12, 12, 6, 3, 3, 0 ),
    array( 12, 12, 6, 3, 2, 1 ),
    array( 12, 12, 6, 2, 2, 2 ),
    array( 12, 12, 5, 5, 2, 0 ),
    array( 12, 12, 5, 5, 1, 1 ),
    array( 12, 12, 5, 4, 3, 0 ),
    array( 12, 12, 5, 4, 2, 1 ),
    array( 12, 12, 5, 3, 3, 1 ),
    array( 12, 12, 5, 3, 2, 2 ),
    array( 12, 12, 4, 4, 4, 0 ),
    array( 12, 12, 4, 4, 3, 1 ),
    array( 12, 12, 4, 4, 2, 2 ),
    array( 12, 12, 4, 3, 3, 2 ),
    array( 12, 12, 3, 3, 3, 3 ),
    array( 12, 11, 11, 2, 0, 0 ),
    array( 12, 11, 11, 1, 1, 0 ),
    array( 12, 11, 10, 3, 0, 0 ),
    array( 12, 11, 10, 2, 1, 0 ),
    array( 12, 11, 10, 1, 1, 1 ),
    array( 12, 11, 9, 4, 0, 0 ),
    array( 12, 11, 9, 3, 1, 0 ),
    array( 12, 11, 9, 2, 2, 0 ),
    array( 12, 11, 9, 2, 1, 1 ),
    array( 12, 11, 8, 5, 0, 0 ),
    array( 12, 11, 8, 4, 1, 0 ),
    array( 12, 11, 8, 3, 2, 0 ),
    array( 12, 11, 8, 3, 1, 1 ),
    array( 12, 11, 8, 2, 2, 1 ),
    array( 12, 11, 7, 6, 0, 0 ),
    array( 12, 11, 7, 5, 1, 0 ),
    array( 12, 11, 7, 4, 2, 0 ),
    array( 12, 11, 7, 4, 1, 1 ),
    array( 12, 11, 7, 3, 3, 0 ),
    array( 12, 11, 7, 3, 2, 1 ),
    array( 12, 11, 7, 2, 2, 2 ),
    array( 12, 11, 6, 6, 1, 0 ),
    array( 12, 11, 6, 5, 2, 0 ),
    array( 12, 11, 6, 5, 1, 1 ),
    array( 12, 11, 6, 4, 3, 0 ),
    array( 12, 11, 6, 4, 2, 1 ),
    array( 12, 11, 6, 3, 3, 1 ),
    array( 12, 11, 6, 3, 2, 2 ),
    array( 12, 11, 5, 5, 3, 0 ),
    array( 12, 11, 5, 5, 2, 1 ),
    array( 12, 11, 5, 4, 4, 0 ),
    array( 12, 11, 5, 4, 3, 1 ),
    array( 12, 11, 5, 4, 2, 2 ),
    array( 12, 11, 5, 3, 3, 2 ),
    array( 12, 11, 4, 4, 4, 1 ),
    array( 12, 11, 4, 4, 3, 2 ),
    array( 12, 11, 4, 3, 3, 3 ),
    array( 12, 10, 10, 4, 0, 0 ),
    array( 12, 10, 10, 3, 1, 0 ),
    array( 12, 10, 10, 2, 2, 0 ),
    array( 12, 10, 10, 2, 1, 1 ),
    array( 12, 10, 9, 5, 0, 0 ),
    array( 12, 10, 9, 4, 1, 0 ),
    array( 12, 10, 9, 3, 2, 0 ),
    array( 12, 10, 9, 3, 1, 1 ),
    array( 12, 10, 9, 2, 2, 1 ),
    array( 12, 10, 8, 6, 0, 0 ),
    array( 12, 10, 8, 5, 1, 0 ),
    array( 12, 10, 8, 4, 2, 0 ),
    array( 12, 10, 8, 4, 1, 1 ),
    array( 12, 10, 8, 3, 3, 0 ),
    array( 12, 10, 8, 3, 2, 1 ),
    array( 12, 10, 8, 2, 2, 2 ),
    array( 12, 10, 7, 7, 0, 0 ),
    array( 12, 10, 7, 6, 1, 0 ),
    array( 12, 10, 7, 5, 2, 0 ),
    array( 12, 10, 7, 5, 1, 1 ),
    array( 12, 10, 7, 4, 3, 0 ),
    array( 12, 10, 7, 4, 2, 1 ),
    array( 12, 10, 7, 3, 3, 1 ),
    array( 12, 10, 7, 3, 2, 2 ),
    array( 12, 10, 6, 6, 2, 0 ),
    array( 12, 10, 6, 6, 1, 1 ),
    array( 12, 10, 6, 5, 3, 0 ),
    array( 12, 10, 6, 5, 2, 1 ),
    array( 12, 10, 6, 4, 4, 0 ),
    array( 12, 10, 6, 4, 3, 1 ),
    array( 12, 10, 6, 4, 2, 2 ),
    array( 12, 10, 6, 3, 3, 2 ),
    array( 12, 10, 5, 5, 4, 0 ),
    array( 12, 10, 5, 5, 3, 1 ),
    array( 12, 10, 5, 5, 2, 2 ),
    array( 12, 10, 5, 4, 4, 1 ),
    array( 12, 10, 5, 4, 3, 2 ),
    array( 12, 10, 5, 3, 3, 3 ),
    array( 12, 10, 4, 4, 4, 2 ),
    array( 12, 10, 4, 4, 3, 3 ),
    array( 12, 9, 9, 6, 0, 0 ),
    array( 12, 9, 9, 5, 1, 0 ),
    array( 12, 9, 9, 4, 2, 0 ),
    array( 12, 9, 9, 4, 1, 1 ),
    array( 12, 9, 9, 3, 3, 0 ),
    array( 12, 9, 9, 3, 2, 1 ),
    array( 12, 9, 9, 2, 2, 2 ),
    array( 12, 9, 8, 7, 0, 0 ),
    array( 12, 9, 8, 6, 1, 0 ),
    array( 12, 9, 8, 5, 2, 0 ),
    array( 12, 9, 8, 5, 1, 1 ),
    array( 12, 9, 8, 4, 3, 0 ),
    array( 12, 9, 8, 4, 2, 1 ),
    array( 12, 9, 8, 3, 3, 1 ),
    array( 12, 9, 8, 3, 2, 2 ),
    array( 12, 9, 7, 7, 1, 0 ),
    array( 12, 9, 7, 6, 2, 0 ),
    array( 12, 9, 7, 6, 1, 1 ),
    array( 12, 9, 7, 5, 3, 0 ),
    array( 12, 9, 7, 5, 2, 1 ),
    array( 12, 9, 7, 4, 4, 0 ),
    array( 12, 9, 7, 4, 3, 1 ),
    array( 12, 9, 7, 4, 2, 2 ),
    array( 12, 9, 7, 3, 3, 2 ),
    array( 12, 9, 6, 6, 3, 0 ),
    array( 12, 9, 6, 6, 2, 1 ),
    array( 12, 9, 6, 5, 4, 0 ),
    array( 12, 9, 6, 5, 3, 1 ),
    array( 12, 9, 6, 5, 2, 2 ),
    array( 12, 9, 6, 4, 4, 1 ),
    array( 12, 9, 6, 4, 3, 2 ),
    array( 12, 9, 6, 3, 3, 3 ),
    array( 12, 9, 5, 5, 5, 0 ),
    array( 12, 9, 5, 5, 4, 1 ),
    array( 12, 9, 5, 5, 3, 2 ),
    array( 12, 9, 5, 4, 4, 2 ),
    array( 12, 9, 5, 4, 3, 3 ),
    array( 12, 9, 4, 4, 4, 3 ),
    array( 12, 8, 8, 8, 0, 0 ),
    array( 12, 8, 8, 7, 1, 0 ),
    array( 12, 8, 8, 6, 2, 0 ),
    array( 12, 8, 8, 6, 1, 1 ),
    array( 12, 8, 8, 5, 3, 0 ),
    array( 12, 8, 8, 5, 2, 1 ),
    array( 12, 8, 8, 4, 4, 0 ),
    array( 12, 8, 8, 4, 3, 1 ),
    array( 12, 8, 8, 4, 2, 2 ),
    array( 12, 8, 8, 3, 3, 2 ),
    array( 12, 8, 7, 7, 2, 0 ),
    array( 12, 8, 7, 7, 1, 1 ),
    array( 12, 8, 7, 6, 3, 0 ),
    array( 12, 8, 7, 6, 2, 1 ),
    array( 12, 8, 7, 5, 4, 0 ),
    array( 12, 8, 7, 5, 3, 1 ),
    array( 12, 8, 7, 5, 2, 2 ),
    array( 12, 8, 7, 4, 4, 1 ),
    array( 12, 8, 7, 4, 3, 2 ),
    array( 12, 8, 7, 3, 3, 3 ),
    array( 12, 8, 6, 6, 4, 0 ),
    array( 12, 8, 6, 6, 3, 1 ),
    array( 12, 8, 6, 6, 2, 2 ),
    array( 12, 8, 6, 5, 5, 0 ),
    array( 12, 8, 6, 5, 4, 1 ),
    array( 12, 8, 6, 5, 3, 2 ),
    array( 12, 8, 6, 4, 4, 2 ),
    array( 12, 8, 6, 4, 3, 3 ),
    array( 12, 8, 5, 5, 5, 1 ),
    array( 12, 8, 5, 5, 4, 2 ),
    array( 12, 8, 5, 5, 3, 3 ),
    array( 12, 8, 5, 4, 4, 3 ),
    array( 12, 8, 4, 4, 4, 4 ),
    array( 12, 7, 7, 7, 3, 0 ),
    array( 12, 7, 7, 7, 2, 1 ),
    array( 12, 7, 7, 6, 4, 0 ),
    array( 12, 7, 7, 6, 3, 1 ),
    array( 12, 7, 7, 6, 2, 2 ),
    array( 12, 7, 7, 5, 5, 0 ),
    array( 12, 7, 7, 5, 4, 1 ),
    array( 12, 7, 7, 5, 3, 2 ),
    array( 12, 7, 7, 4, 4, 2 ),
    array( 12, 7, 7, 4, 3, 3 ),
    array( 12, 7, 6, 6, 5, 0 ),
    array( 12, 7, 6, 6, 4, 1 ),
    array( 12, 7, 6, 6, 3, 2 ),
    array( 12, 7, 6, 5, 5, 1 ),
    array( 12, 7, 6, 5, 4, 2 ),
    array( 12, 7, 6, 5, 3, 3 ),
    array( 12, 7, 6, 4, 4, 3 ),
    array( 12, 7, 5, 5, 5, 2 ),
    array( 12, 7, 5, 5, 4, 3 ),
    array( 12, 7, 5, 4, 4, 4 ),
    array( 12, 6, 6, 6, 6, 0 ),
    array( 12, 6, 6, 6, 5, 1 ),
    array( 12, 6, 6, 6, 4, 2 ),
    array( 12, 6, 6, 6, 3, 3 ),
    array( 12, 6, 6, 5, 5, 2 ),
    array( 12, 6, 6, 5, 4, 3 ),
    array( 12, 6, 6, 4, 4, 4 ),
    array( 12, 6, 5, 5, 5, 3 ),
    array( 12, 6, 5, 5, 4, 4 ),
    array( 12, 5, 5, 5, 5, 4 ),
    array( 11, 11, 11, 3, 0, 0 ),
    array( 11, 11, 11, 2, 1, 0 ),
    array( 11, 11, 11, 1, 1, 1 ),
    array( 11, 11, 10, 4, 0, 0 ),
    array( 11, 11, 10, 3, 1, 0 ),
    array( 11, 11, 10, 2, 2, 0 ),
    array( 11, 11, 10, 2, 1, 1 ),
    array( 11, 11, 9, 5, 0, 0 ),
    array( 11, 11, 9, 4, 1, 0 ),
    array( 11, 11, 9, 3, 2, 0 ),
    array( 11, 11, 9, 3, 1, 1 ),
    array( 11, 11, 9, 2, 2, 1 ),
    array( 11, 11, 8, 6, 0, 0 ),
    array( 11, 11, 8, 5, 1, 0 ),
    array( 11, 11, 8, 4, 2, 0 ),
    array( 11, 11, 8, 4, 1, 1 ),
    array( 11, 11, 8, 3, 3, 0 ),
    array( 11, 11, 8, 3, 2, 1 ),
    array( 11, 11, 8, 2, 2, 2 ),
    array( 11, 11, 7, 7, 0, 0 ),
    array( 11, 11, 7, 6, 1, 0 ),
    array( 11, 11, 7, 5, 2, 0 ),
    array( 11, 11, 7, 5, 1, 1 ),
    array( 11, 11, 7, 4, 3, 0 ),
    array( 11, 11, 7, 4, 2, 1 ),
    array( 11, 11, 7, 3, 3, 1 ),
    array( 11, 11, 7, 3, 2, 2 ),
    array( 11, 11, 6, 6, 2, 0 ),
    array( 11, 11, 6, 6, 1, 1 ),
    array( 11, 11, 6, 5, 3, 0 ),
    array( 11, 11, 6, 5, 2, 1 ),
    array( 11, 11, 6, 4, 4, 0 ),
    array( 11, 11, 6, 4, 3, 1 ),
    array( 11, 11, 6, 4, 2, 2 ),
    array( 11, 11, 6, 3, 3, 2 ),
    array( 11, 11, 5, 5, 4, 0 ),
    array( 11, 11, 5, 5, 3, 1 ),
    array( 11, 11, 5, 5, 2, 2 ),
    array( 11, 11, 5, 4, 4, 1 ),
    array( 11, 11, 5, 4, 3, 2 ),
    array( 11, 11, 5, 3, 3, 3 ),
    array( 11, 11, 4, 4, 4, 2 ),
    array( 11, 11, 4, 4, 3, 3 ),
    array( 11, 10, 10, 5, 0, 0 ),
    array( 11, 10, 10, 4, 1, 0 ),
    array( 11, 10, 10, 3, 2, 0 ),
    array( 11, 10, 10, 3, 1, 1 ),
    array( 11, 10, 10, 2, 2, 1 ),
    array( 11, 10, 9, 6, 0, 0 ),
    array( 11, 10, 9, 5, 1, 0 ),
    array( 11, 10, 9, 4, 2, 0 ),
    array( 11, 10, 9, 4, 1, 1 ),
    array( 11, 10, 9, 3, 3, 0 ),
    array( 11, 10, 9, 3, 2, 1 ),
    array( 11, 10, 9, 2, 2, 2 ),
    array( 11, 10, 8, 7, 0, 0 ),
    array( 11, 10, 8, 6, 1, 0 ),
    array( 11, 10, 8, 5, 2, 0 ),
    array( 11, 10, 8, 5, 1, 1 ),
    array( 11, 10, 8, 4, 3, 0 ),
    array( 11, 10, 8, 4, 2, 1 ),
    array( 11, 10, 8, 3, 3, 1 ),
    array( 11, 10, 8, 3, 2, 2 ),
    array( 11, 10, 7, 7, 1, 0 ),
    array( 11, 10, 7, 6, 2, 0 ),
    array( 11, 10, 7, 6, 1, 1 ),
    array( 11, 10, 7, 5, 3, 0 ),
    array( 11, 10, 7, 5, 2, 1 ),
    array( 11, 10, 7, 4, 4, 0 ),
    array( 11, 10, 7, 4, 3, 1 ),
    array( 11, 10, 7, 4, 2, 2 ),
    array( 11, 10, 7, 3, 3, 2 ),
    array( 11, 10, 6, 6, 3, 0 ),
    array( 11, 10, 6, 6, 2, 1 ),
    array( 11, 10, 6, 5, 4, 0 ),
    array( 11, 10, 6, 5, 3, 1 ),
    array( 11, 10, 6, 5, 2, 2 ),
    array( 11, 10, 6, 4, 4, 1 ),
    array( 11, 10, 6, 4, 3, 2 ),
    array( 11, 10, 6, 3, 3, 3 ),
    array( 11, 10, 5, 5, 5, 0 ),
    array( 11, 10, 5, 5, 4, 1 ),
    array( 11, 10, 5, 5, 3, 2 ),
    array( 11, 10, 5, 4, 4, 2 ),
    array( 11, 10, 5, 4, 3, 3 ),
    array( 11, 10, 4, 4, 4, 3 ),
    array( 11, 9, 9, 7, 0, 0 ),
    array( 11, 9, 9, 6, 1, 0 ),
    array( 11, 9, 9, 5, 2, 0 ),
    array( 11, 9, 9, 5, 1, 1 ),
    array( 11, 9, 9, 4, 3, 0 ),
    array( 11, 9, 9, 4, 2, 1 ),
    array( 11, 9, 9, 3, 3, 1 ),
    array( 11, 9, 9, 3, 2, 2 ),
    array( 11, 9, 8, 8, 0, 0 ),
    array( 11, 9, 8, 7, 1, 0 ),
    array( 11, 9, 8, 6, 2, 0 ),
    array( 11, 9, 8, 6, 1, 1 ),
    array( 11, 9, 8, 5, 3, 0 ),
    array( 11, 9, 8, 5, 2, 1 ),
    array( 11, 9, 8, 4, 4, 0 ),
    array( 11, 9, 8, 4, 3, 1 ),
    array( 11, 9, 8, 4, 2, 2 ),
    array( 11, 9, 8, 3, 3, 2 ),
    array( 11, 9, 7, 7, 2, 0 ),
    array( 11, 9, 7, 7, 1, 1 ),
    array( 11, 9, 7, 6, 3, 0 ),
    array( 11, 9, 7, 6, 2, 1 ),
    array( 11, 9, 7, 5, 4, 0 ),
    array( 11, 9, 7, 5, 3, 1 ),
    array( 11, 9, 7, 5, 2, 2 ),
    array( 11, 9, 7, 4, 4, 1 ),
    array( 11, 9, 7, 4, 3, 2 ),
    array( 11, 9, 7, 3, 3, 3 ),
    array( 11, 9, 6, 6, 4, 0 ),
    array( 11, 9, 6, 6, 3, 1 ),
    array( 11, 9, 6, 6, 2, 2 ),
    array( 11, 9, 6, 5, 5, 0 ),
    array( 11, 9, 6, 5, 4, 1 ),
    array( 11, 9, 6, 5, 3, 2 ),
    array( 11, 9, 6, 4, 4, 2 ),
    array( 11, 9, 6, 4, 3, 3 ),
    array( 11, 9, 5, 5, 5, 1 ),
    array( 11, 9, 5, 5, 4, 2 ),
    array( 11, 9, 5, 5, 3, 3 ),
    array( 11, 9, 5, 4, 4, 3 ),
    array( 11, 9, 4, 4, 4, 4 ),
    array( 11, 8, 8, 8, 1, 0 ),
    array( 11, 8, 8, 7, 2, 0 ),
    array( 11, 8, 8, 7, 1, 1 ),
    array( 11, 8, 8, 6, 3, 0 ),
    array( 11, 8, 8, 6, 2, 1 ),
    array( 11, 8, 8, 5, 4, 0 ),
    array( 11, 8, 8, 5, 3, 1 ),
    array( 11, 8, 8, 5, 2, 2 ),
    array( 11, 8, 8, 4, 4, 1 ),
    array( 11, 8, 8, 4, 3, 2 ),
    array( 11, 8, 8, 3, 3, 3 ),
    array( 11, 8, 7, 7, 3, 0 ),
    array( 11, 8, 7, 7, 2, 1 ),
    array( 11, 8, 7, 6, 4, 0 ),
    array( 11, 8, 7, 6, 3, 1 ),
    array( 11, 8, 7, 6, 2, 2 ),
    array( 11, 8, 7, 5, 5, 0 ),
    array( 11, 8, 7, 5, 4, 1 ),
    array( 11, 8, 7, 5, 3, 2 ),
    array( 11, 8, 7, 4, 4, 2 ),
    array( 11, 8, 7, 4, 3, 3 ),
    array( 11, 8, 6, 6, 5, 0 ),
    array( 11, 8, 6, 6, 4, 1 ),
    array( 11, 8, 6, 6, 3, 2 ),
    array( 11, 8, 6, 5, 5, 1 ),
    array( 11, 8, 6, 5, 4, 2 ),
    array( 11, 8, 6, 5, 3, 3 ),
    array( 11, 8, 6, 4, 4, 3 ),
    array( 11, 8, 5, 5, 5, 2 ),
    array( 11, 8, 5, 5, 4, 3 ),
    array( 11, 8, 5, 4, 4, 4 ),
    array( 11, 7, 7, 7, 4, 0 ),
    array( 11, 7, 7, 7, 3, 1 ),
    array( 11, 7, 7, 7, 2, 2 ),
    array( 11, 7, 7, 6, 5, 0 ),
    array( 11, 7, 7, 6, 4, 1 ),
    array( 11, 7, 7, 6, 3, 2 ),
    array( 11, 7, 7, 5, 5, 1 ),
    array( 11, 7, 7, 5, 4, 2 ),
    array( 11, 7, 7, 5, 3, 3 ),
    array( 11, 7, 7, 4, 4, 3 ),
    array( 11, 7, 6, 6, 6, 0 ),
    array( 11, 7, 6, 6, 5, 1 ),
    array( 11, 7, 6, 6, 4, 2 ),
    array( 11, 7, 6, 6, 3, 3 ),
    array( 11, 7, 6, 5, 5, 2 ),
    array( 11, 7, 6, 5, 4, 3 ),
    array( 11, 7, 6, 4, 4, 4 ),
    array( 11, 7, 5, 5, 5, 3 ),
    array( 11, 7, 5, 5, 4, 4 ),
    array( 11, 6, 6, 6, 6, 1 ),
    array( 11, 6, 6, 6, 5, 2 ),
    array( 11, 6, 6, 6, 4, 3 ),
    array( 11, 6, 6, 5, 5, 3 ),
    array( 11, 6, 6, 5, 4, 4 ),
    array( 11, 6, 5, 5, 5, 4 ),
    array( 11, 5, 5, 5, 5, 5 ),
    array( 10, 10, 10, 6, 0, 0 ),
    array( 10, 10, 10, 5, 1, 0 ),
    array( 10, 10, 10, 4, 2, 0 ),
    array( 10, 10, 10, 4, 1, 1 ),
    array( 10, 10, 10, 3, 3, 0 ),
    array( 10, 10, 10, 3, 2, 1 ),
    array( 10, 10, 10, 2, 2, 2 ),
    array( 10, 10, 9, 7, 0, 0 ),
    array( 10, 10, 9, 6, 1, 0 ),
    array( 10, 10, 9, 5, 2, 0 ),
    array( 10, 10, 9, 5, 1, 1 ),
    array( 10, 10, 9, 4, 3, 0 ),
    array( 10, 10, 9, 4, 2, 1 ),
    array( 10, 10, 9, 3, 3, 1 ),
    array( 10, 10, 9, 3, 2, 2 ),
    array( 10, 10, 8, 8, 0, 0 ),
    array( 10, 10, 8, 7, 1, 0 ),
    array( 10, 10, 8, 6, 2, 0 ),
    array( 10, 10, 8, 6, 1, 1 ),
    array( 10, 10, 8, 5, 3, 0 ),
    array( 10, 10, 8, 5, 2, 1 ),
    array( 10, 10, 8, 4, 4, 0 ),
    array( 10, 10, 8, 4, 3, 1 ),
    array( 10, 10, 8, 4, 2, 2 ),
    array( 10, 10, 8, 3, 3, 2 ),
    array( 10, 10, 7, 7, 2, 0 ),
    array( 10, 10, 7, 7, 1, 1 ),
    array( 10, 10, 7, 6, 3, 0 ),
    array( 10, 10, 7, 6, 2, 1 ),
    array( 10, 10, 7, 5, 4, 0 ),
    array( 10, 10, 7, 5, 3, 1 ),
    array( 10, 10, 7, 5, 2, 2 ),
    array( 10, 10, 7, 4, 4, 1 ),
    array( 10, 10, 7, 4, 3, 2 ),
    array( 10, 10, 7, 3, 3, 3 ),
    array( 10, 10, 6, 6, 4, 0 ),
    array( 10, 10, 6, 6, 3, 1 ),
    array( 10, 10, 6, 6, 2, 2 ),
    array( 10, 10, 6, 5, 5, 0 ),
    array( 10, 10, 6, 5, 4, 1 ),
    array( 10, 10, 6, 5, 3, 2 ),
    array( 10, 10, 6, 4, 4, 2 ),
    array( 10, 10, 6, 4, 3, 3 ),
    array( 10, 10, 5, 5, 5, 1 ),
    array( 10, 10, 5, 5, 4, 2 ),
    array( 10, 10, 5, 5, 3, 3 ),
    array( 10, 10, 5, 4, 4, 3 ),
    array( 10, 10, 4, 4, 4, 4 ),
    array( 10, 9, 9, 8, 0, 0 ),
    array( 10, 9, 9, 7, 1, 0 ),
    array( 10, 9, 9, 6, 2, 0 ),
    array( 10, 9, 9, 6, 1, 1 ),
    array( 10, 9, 9, 5, 3, 0 ),
    array( 10, 9, 9, 5, 2, 1 ),
    array( 10, 9, 9, 4, 4, 0 ),
    array( 10, 9, 9, 4, 3, 1 ),
    array( 10, 9, 9, 4, 2, 2 ),
    array( 10, 9, 9, 3, 3, 2 ),
    array( 10, 9, 8, 8, 1, 0 ),
    array( 10, 9, 8, 7, 2, 0 ),
    array( 10, 9, 8, 7, 1, 1 ),
    array( 10, 9, 8, 6, 3, 0 ),
    array( 10, 9, 8, 6, 2, 1 ),
    array( 10, 9, 8, 5, 4, 0 ),
    array( 10, 9, 8, 5, 3, 1 ),
    array( 10, 9, 8, 5, 2, 2 ),
    array( 10, 9, 8, 4, 4, 1 ),
    array( 10, 9, 8, 4, 3, 2 ),
    array( 10, 9, 8, 3, 3, 3 ),
    array( 10, 9, 7, 7, 3, 0 ),
    array( 10, 9, 7, 7, 2, 1 ),
    array( 10, 9, 7, 6, 4, 0 ),
    array( 10, 9, 7, 6, 3, 1 ),
    array( 10, 9, 7, 6, 2, 2 ),
    array( 10, 9, 7, 5, 5, 0 ),
    array( 10, 9, 7, 5, 4, 1 ),
    array( 10, 9, 7, 5, 3, 2 ),
    array( 10, 9, 7, 4, 4, 2 ),
    array( 10, 9, 7, 4, 3, 3 ),
    array( 10, 9, 6, 6, 5, 0 ),
    array( 10, 9, 6, 6, 4, 1 ),
    array( 10, 9, 6, 6, 3, 2 ),
    array( 10, 9, 6, 5, 5, 1 ),
    array( 10, 9, 6, 5, 4, 2 ),
    array( 10, 9, 6, 5, 3, 3 ),
    array( 10, 9, 6, 4, 4, 3 ),
    array( 10, 9, 5, 5, 5, 2 ),
    array( 10, 9, 5, 5, 4, 3 ),
    array( 10, 9, 5, 4, 4, 4 ),
    array( 10, 8, 8, 8, 2, 0 ),
    array( 10, 8, 8, 8, 1, 1 ),
    array( 10, 8, 8, 7, 3, 0 ),
    array( 10, 8, 8, 7, 2, 1 ),
    array( 10, 8, 8, 6, 4, 0 ),
    array( 10, 8, 8, 6, 3, 1 ),
    array( 10, 8, 8, 6, 2, 2 ),
    array( 10, 8, 8, 5, 5, 0 ),
    array( 10, 8, 8, 5, 4, 1 ),
    array( 10, 8, 8, 5, 3, 2 ),
    array( 10, 8, 8, 4, 4, 2 ),
    array( 10, 8, 8, 4, 3, 3 ),
    array( 10, 8, 7, 7, 4, 0 ),
    array( 10, 8, 7, 7, 3, 1 ),
    array( 10, 8, 7, 7, 2, 2 ),
    array( 10, 8, 7, 6, 5, 0 ),
    array( 10, 8, 7, 6, 4, 1 ),
    array( 10, 8, 7, 6, 3, 2 ),
    array( 10, 8, 7, 5, 5, 1 ),
    array( 10, 8, 7, 5, 4, 2 ),
    array( 10, 8, 7, 5, 3, 3 ),
    array( 10, 8, 7, 4, 4, 3 ),
    array( 10, 8, 6, 6, 6, 0 ),
    array( 10, 8, 6, 6, 5, 1 ),
    array( 10, 8, 6, 6, 4, 2 ),
    array( 10, 8, 6, 6, 3, 3 ),
    array( 10, 8, 6, 5, 5, 2 ),
    array( 10, 8, 6, 5, 4, 3 ),
    array( 10, 8, 6, 4, 4, 4 ),
    array( 10, 8, 5, 5, 5, 3 ),
    array( 10, 8, 5, 5, 4, 4 ),
    array( 10, 7, 7, 7, 5, 0 ),
    array( 10, 7, 7, 7, 4, 1 ),
    array( 10, 7, 7, 7, 3, 2 ),
    array( 10, 7, 7, 6, 6, 0 ),
    array( 10, 7, 7, 6, 5, 1 ),
    array( 10, 7, 7, 6, 4, 2 ),
    array( 10, 7, 7, 6, 3, 3 ),
    array( 10, 7, 7, 5, 5, 2 ),
    array( 10, 7, 7, 5, 4, 3 ),
    array( 10, 7, 7, 4, 4, 4 ),
    array( 10, 7, 6, 6, 6, 1 ),
    array( 10, 7, 6, 6, 5, 2 ),
    array( 10, 7, 6, 6, 4, 3 ),
    array( 10, 7, 6, 5, 5, 3 ),
    array( 10, 7, 6, 5, 4, 4 ),
    array( 10, 7, 5, 5, 5, 4 ),
    array( 10, 6, 6, 6, 6, 2 ),
    array( 10, 6, 6, 6, 5, 3 ),
    array( 10, 6, 6, 6, 4, 4 ),
    array( 10, 6, 6, 5, 5, 4 ),
    array( 10, 6, 5, 5, 5, 5 ),
    array( 9, 9, 9, 9, 0, 0 ),
    array( 9, 9, 9, 8, 1, 0 ),
    array( 9, 9, 9, 7, 2, 0 ),
    array( 9, 9, 9, 7, 1, 1 ),
    array( 9, 9, 9, 6, 3, 0 ),
    array( 9, 9, 9, 6, 2, 1 ),
    array( 9, 9, 9, 5, 4, 0 ),
    array( 9, 9, 9, 5, 3, 1 ),
    array( 9, 9, 9, 5, 2, 2 ),
    array( 9, 9, 9, 4, 4, 1 ),
    array( 9, 9, 9, 4, 3, 2 ),
    array( 9, 9, 9, 3, 3, 3 ),
    array( 9, 9, 8, 8, 2, 0 ),
    array( 9, 9, 8, 8, 1, 1 ),
    array( 9, 9, 8, 7, 3, 0 ),
    array( 9, 9, 8, 7, 2, 1 ),
    array( 9, 9, 8, 6, 4, 0 ),
    array( 9, 9, 8, 6, 3, 1 ),
    array( 9, 9, 8, 6, 2, 2 ),
    array( 9, 9, 8, 5, 5, 0 ),
    array( 9, 9, 8, 5, 4, 1 ),
    array( 9, 9, 8, 5, 3, 2 ),
    array( 9, 9, 8, 4, 4, 2 ),
    array( 9, 9, 8, 4, 3, 3 ),
    array( 9, 9, 7, 7, 4, 0 ),
    array( 9, 9, 7, 7, 3, 1 ),
    array( 9, 9, 7, 7, 2, 2 ),
    array( 9, 9, 7, 6, 5, 0 ),
    array( 9, 9, 7, 6, 4, 1 ),
    array( 9, 9, 7, 6, 3, 2 ),
    array( 9, 9, 7, 5, 5, 1 ),
    array( 9, 9, 7, 5, 4, 2 ),
    array( 9, 9, 7, 5, 3, 3 ),
    array( 9, 9, 7, 4, 4, 3 ),
    array( 9, 9, 6, 6, 6, 0 ),
    array( 9, 9, 6, 6, 5, 1 ),
    array( 9, 9, 6, 6, 4, 2 ),
    array( 9, 9, 6, 6, 3, 3 ),
    array( 9, 9, 6, 5, 5, 2 ),
    array( 9, 9, 6, 5, 4, 3 ),
    array( 9, 9, 6, 4, 4, 4 ),
    array( 9, 9, 5, 5, 5, 3 ),
    array( 9, 9, 5, 5, 4, 4 ),
    array( 9, 8, 8, 8, 3, 0 ),
    array( 9, 8, 8, 8, 2, 1 ),
    array( 9, 8, 8, 7, 4, 0 ),
    array( 9, 8, 8, 7, 3, 1 ),
    array( 9, 8, 8, 7, 2, 2 ),
    array( 9, 8, 8, 6, 5, 0 ),
    array( 9, 8, 8, 6, 4, 1 ),
    array( 9, 8, 8, 6, 3, 2 ),
    array( 9, 8, 8, 5, 5, 1 ),
    array( 9, 8, 8, 5, 4, 2 ),
    array( 9, 8, 8, 5, 3, 3 ),
    array( 9, 8, 8, 4, 4, 3 ),
    array( 9, 8, 7, 7, 5, 0 ),
    array( 9, 8, 7, 7, 4, 1 ),
    array( 9, 8, 7, 7, 3, 2 ),
    array( 9, 8, 7, 6, 6, 0 ),
    array( 9, 8, 7, 6, 5, 1 ),
    array( 9, 8, 7, 6, 4, 2 ),
    array( 9, 8, 7, 6, 3, 3 ),
    array( 9, 8, 7, 5, 5, 2 ),
    array( 9, 8, 7, 5, 4, 3 ),
    array( 9, 8, 7, 4, 4, 4 ),
    array( 9, 8, 6, 6, 6, 1 ),
    array( 9, 8, 6, 6, 5, 2 ),
    array( 9, 8, 6, 6, 4, 3 ),
    array( 9, 8, 6, 5, 5, 3 ),
    array( 9, 8, 6, 5, 4, 4 ),
    array( 9, 8, 5, 5, 5, 4 ),
    array( 9, 7, 7, 7, 6, 0 ),
    array( 9, 7, 7, 7, 5, 1 ),
    array( 9, 7, 7, 7, 4, 2 ),
    array( 9, 7, 7, 7, 3, 3 ),
    array( 9, 7, 7, 6, 6, 1 ),
    array( 9, 7, 7, 6, 5, 2 ),
    array( 9, 7, 7, 6, 4, 3 ),
    array( 9, 7, 7, 5, 5, 3 ),
    array( 9, 7, 7, 5, 4, 4 ),
    array( 9, 7, 6, 6, 6, 2 ),
    array( 9, 7, 6, 6, 5, 3 ),
    array( 9, 7, 6, 6, 4, 4 ),
    array( 9, 7, 6, 5, 5, 4 ),
    array( 9, 7, 5, 5, 5, 5 ),
    array( 9, 6, 6, 6, 6, 3 ),
    array( 9, 6, 6, 6, 5, 4 ),
    array( 9, 6, 6, 5, 5, 5 ),
    array( 8, 8, 8, 8, 4, 0 ),
    array( 8, 8, 8, 8, 3, 1 ),
    array( 8, 8, 8, 8, 2, 2 ),
    array( 8, 8, 8, 7, 5, 0 ),
    array( 8, 8, 8, 7, 4, 1 ),
    array( 8, 8, 8, 7, 3, 2 ),
    array( 8, 8, 8, 6, 6, 0 ),
    array( 8, 8, 8, 6, 5, 1 ),
    array( 8, 8, 8, 6, 4, 2 ),
    array( 8, 8, 8, 6, 3, 3 ),
    array( 8, 8, 8, 5, 5, 2 ),
    array( 8, 8, 8, 5, 4, 3 ),
    array( 8, 8, 8, 4, 4, 4 ),
    array( 8, 8, 7, 7, 6, 0 ),
    array( 8, 8, 7, 7, 5, 1 ),
    array( 8, 8, 7, 7, 4, 2 ),
    array( 8, 8, 7, 7, 3, 3 ),
    array( 8, 8, 7, 6, 6, 1 ),
    array( 8, 8, 7, 6, 5, 2 ),
    array( 8, 8, 7, 6, 4, 3 ),
    array( 8, 8, 7, 5, 5, 3 ),
    array( 8, 8, 7, 5, 4, 4 ),
    array( 8, 8, 6, 6, 6, 2 ),
    array( 8, 8, 6, 6, 5, 3 ),
    array( 8, 8, 6, 6, 4, 4 ),
    array( 8, 8, 6, 5, 5, 4 ),
    array( 8, 8, 5, 5, 5, 5 ),
    array( 8, 7, 7, 7, 7, 0 ),
    array( 8, 7, 7, 7, 6, 1 ),
    array( 8, 7, 7, 7, 5, 2 ),
    array( 8, 7, 7, 7, 4, 3 ),
    array( 8, 7, 7, 6, 6, 2 ),
    array( 8, 7, 7, 6, 5, 3 ),
    array( 8, 7, 7, 6, 4, 4 ),
    array( 8, 7, 7, 5, 5, 4 ),
    array( 8, 7, 6, 6, 6, 3 ),
    array( 8, 7, 6, 6, 5, 4 ),
    array( 8, 7, 6, 5, 5, 5 ),
    array( 8, 6, 6, 6, 6, 4 ),
    array( 8, 6, 6, 6, 5, 5 ),
    array( 7, 7, 7, 7, 7, 1 ),
    array( 7, 7, 7, 7, 6, 2 ),
    array( 7, 7, 7, 7, 5, 3 ),
    array( 7, 7, 7, 7, 4, 4 ),
    array( 7, 7, 7, 6, 6, 3 ),
    array( 7, 7, 7, 6, 5, 4 ),
    array( 7, 7, 7, 5, 5, 5 ),
    array( 7, 7, 6, 6, 6, 4 ),
    array( 7, 7, 6, 6, 5, 5 ),
    array( 7, 6, 6, 6, 6, 5 ),
    array( 6, 6, 6, 6, 6, 6 ),
);
于 2012-07-12T00:23:15.323 回答