src/GameOfLife/Rules/BaseRule.php
/**
     * Converts the rule to its anti rule.
     */
Converts the rule to its anti rule.
Converts the rule to its anti rule .
private function convertToAntiRule()
    {
        $rulesStayAlive = range(0, 8);
        foreach ($this->rulesBirth as $amountNeighborsBirth)
        {
            unset($rulesStayAlive[8 - $amountNeighborsBirth]);
        }
        $rulesBirth = range(0, 8);
        foreach ($this->rulesStayAlive as $amountNeighborsStayAlive)
        {
            unset($rulesBirth[8 - $amountNeighborsStayAlive]);
        }
        $this->rulesStayAlive = array_values($rulesStayAlive);
        $this->rulesBirth = array_values($rulesBirth);
    }
private function convertToAntiRule ( ) { $ rulesStayAlive = range ( 0 , 8 ) ; foreach ( $ this -> rulesBirth as $ amountNeighborsBirth ) { unset ( $ rulesStayAlive [ 8 - $ amountNeighborsBirth ] ) ; } $ rulesBirth = range ( 0 , 8 ) ; foreach ( $ this -> rulesStayAlive as $ amountNeighborsStayAlive ) { unset ( $ rulesBirth [ 8 - $ amountNeighborsStayAlive ] ) ; } $ this -> rulesStayAlive = array_values ( $ rulesStayAlive ) ; $ this -> rulesBirth = array_values ( $ rulesBirth ) ; }
Converts the rule to its anti rule.
Converts the rule to its anti rule .