public function move($player, $move)
    {
        $this->checkPlayer($player);
        $this->checkMove($move);

        // Take seeds in hand
        $hand = $this->grid[$player]['seeds'][$move];
        $this->grid[$player]['seeds'][$move] = 0;

        $row = $player;
        $box = $move;

        /**
         * Dispatch seeds
         */
        while ($hand > 0) {
            if (0 === $row) {
                if (0 === $box) {
                    $row = 1;
                } else {
                    $box--;
                }
            } else {
                if (5 === $box) {
                    $row = 0;
                } else {
                    $box++;
                }
            }

            // Feed box
            if (($row !== $player) || ($box !== $move)) {
                $hand--;
                $this->grid[$row]['seeds'][$box]++;
            }
        }

        /**
         * Anti starve check
         */
        if ((0 === $row && 0 === $box) || (1 === $row && 5 === $box)) {
            if (($row !== $player) && self::allSeedsVulnerable($this->grid[$row]['seeds'])) {
                return $this;
            }
        }

        /**
         * Store opponent seeds
         */
        while (($row !== $player) && in_array($this->grid[$row]['seeds'][$box], array(2, 3))) {
            // Store his seeds
            $this->grid[$player]['attic'] += $this->grid[$row]['seeds'][$box];
            $this->grid[$row]['seeds'][$box] = 0;

            // Check previous box
            if (0 === $row) {
                if (5 === $box) {
                    $row = 1;
                } else {
                    $box++;
                }
            } else {
                if (0 === $box) {
                    $row = 0;
                } else {
                    $box--;
                }
            }
        }

        return $this;
    }
public function move($player, $move)
    {
        $this->checkPlayer($player);
        $this->checkMove($move);

        // Take seeds in hand
        $hand = $this->grid[$player]['seeds'][$move];
        $this->grid[$player]['seeds'][$move] = 0;

        $row = $player;
        $box = $move;

        /**
         * Dispatch seeds
         */
        while ($hand > 0) {
            if (0 === $row) {
                if (0 === $box) {
                    $row = 1;
                } else {
                    $box--;
                }
            } else {
                if (5 === $box) {
                    $row = 0;
                } else {
                    $box++;
                }
            }

            // Feed box
            if (($row !== $player) || ($box !== $move)) {
                $hand--;
                $this->grid[$row]['seeds'][$box]++;
            }
        }

        /**
         * Anti starve check
         */
        if ((0 === $row && 0 === $box) || (1 === $row && 5 === $box)) {
            if (($row !== $player) && self::allSeedsVulnerable($this->grid[$row]['seeds'])) {
                return $this;
            }
        }

        /**
         * Store opponent seeds
         */
        while (($row !== $player) && in_array($this->grid[$row]['seeds'][$box], array(2, 3))) {
            // Store his seeds
            $this->grid[$player]['attic'] += $this->grid[$row]['seeds'][$box];
            $this->grid[$row]['seeds'][$box] = 0;

            // Check previous box
            if (0 === $row) {
                if (5 === $box) {
                    $row = 1;
                } else {
                    $box++;
                }
            } else {
                if (0 === $box) {
                    $row = 0;
                } else {
                    $box--;
                }
            }
        }

        return $this;
    }
public function move ( $ player , $ move ) { $ this -> checkPlayer ( $ player ) ; $ this -> checkMove ( $ move ) ; // Take seeds in hand $ hand = $ this -> grid [ $ player ] [ 'seeds' ] [ $ move ] ; $ this -> grid [ $ player ] [ 'seeds' ] [ $ move ] = 0 ; $ row = $ player ; $ box = $ move ; /**
         * Dispatch seeds
         */ while ( $ hand > 0 ) { if ( 0 === $ row ) { if ( 0 === $ box ) { $ row = 1 ; } else { $ box -- ; } } else { if ( 5 === $ box ) { $ row = 0 ; } else { $ box ++ ; } } // Feed box if ( ( $ row !== $ player ) || ( $ box !== $ move ) ) { $ hand -- ; $ this -> grid [ $ row ] [ 'seeds' ] [ $ box ] ++ ; } } /**
         * Anti starve check
         */ if ( ( 0 === $ row && 0 === $ box ) || ( 1 === $ row && 5 === $ box ) ) { if ( ( $ row !== $ player ) && self :: allSeedsVulnerable ( $ this -> grid [ $ row ] [ 'seeds' ] ) ) { return $ this ; } } /**
         * Store opponent seeds
         */ while ( ( $ row !== $ player ) && in_array ( $ this -> grid [ $ row ] [ 'seeds' ] [ $ box ] , array ( 2 , 3 ) ) ) { // Store his seeds $ this -> grid [ $ player ] [ 'attic' ] += $ this -> grid [ $ row ] [ 'seeds' ] [ $ box ] ; $ this -> grid [ $ row ] [ 'seeds' ] [ $ box ] = 0 ; // Check previous box if ( 0 === $ row ) { if ( 5 === $ box ) { $ row = 1 ; } else { $ box ++ ; } } else { if ( 0 === $ box ) { $ row = 0 ; } else { $ box -- ; } } } return $ this ; }
Play a move naively.
Do not check player turn.

@param int $player
@param int $move

@return self

@throws AwaleException on invalid input value.
Play a move naively . Do not check player turn .