public function play_turn($turn)
    {
        $directions = ['forward', 'left', 'right', 'backward'];
        foreach ($directions as $direction) {
            if ($turn->feel($direction)->is_player()) {
                $turn->attack($direction);
                return;
            }
        }
    }
public function play_turn($turn)
    {
        $directions = ['forward', 'left', 'right', 'backward'];
        foreach ($directions as $direction) {
            if ($turn->feel($direction)->is_player()) {
                $turn->attack($direction);
                return;
            }
        }
    }
public function play_turn ( $ turn ) { $ directions = [ 'forward' , 'left' , 'right' , 'backward' ] ; foreach ( $ directions as $ direction ) { if ( $ turn -> feel ( $ direction ) -> is_player ( ) ) { $ turn -> attack ( $ direction ) ; return ; } } }
Play your turn.

@param $turn
Play your turn .