This action acts as a hub : Depending on the first step of the game, it will forward the action to this step
332496
public function homeAction()
    {
        // This fix exists only for safari in FB on Windows : we need to redirect the user to the page
        // outside of iframe for the cookie to be accepted. PlaygroundCore redirects to the FB Iframed page when
        // it discovers that the user arrives for the first time on the game in FB.
        // When core redirects, it adds a 'redir_fb_page_id' var in the querystring
        // Here, we test if this var exist, and then send the user back to the game in FB.
        // Now the cookie will be accepted by Safari...
        $pageId = $this->params()->fromQuery('redir_fb_page_id');
        if (!empty($pageId)) {
            $appId = 'app_'.$this->game->getFbAppId();
            $url   = '//www.facebook.com/pages/game/'.$pageId.'?sk='.$appId;

            return $this->redirect()->toUrl($url);
        }

        // If an entry has already been done during this session, I reset the anonymous_identifier cookie
        // so that another person can play the same game (if game conditions are fullfilled)
        // or the same person can play another game
        $session = new Container('anonymous_identifier');
        if ($session->offsetExists('anonymous_identifier')) {
            $session->offsetUnset('anonymous_identifier');
        }

        $classGame = __NAMESPACE__ . '\\' . ucfirst($this->game->getClassType());
        return $this->forward()->dispatch(
            $classGame,
            array(
                'controller' => $classGame,
                'action'     => $this->game->firstStep(),
                'id'         => $this->game->getIdentifier()
            )
        );
    }
1315661
public void forEachIndexed(int from, int step,
                               @NotNull IndexedConsumer<? super T> action) {
        int index = from;
        while (iterator.hasNext()) {
            action.accept(index, iterator.next());
            index += step;
        }
    }
409405
private function setupLeftToAct()
    {
        if ($this->players()->count() === 2) {
            $this->leftToAct = $this->leftToAct()->setup($this->players());

            return;
        }

        $this->leftToAct = $this->leftToAct
            ->setup($this->players())
            ->resetPlayerListFromSeat($this->table()->button() + 1);
    }
160268
private void forward(int[] o, double[][] alpha, double[] scaling) {
        for (int k = 0; k < numStates; k++) {
            alpha[0][k] = pi[k] * b[k][o[0]];
        }
        scale(scaling, alpha, 0);

        for (int t = 1; t < o.length; t++) {
            for (int k = 0; k < numStates; k++) {
                double sum = 0.0;

                for (int i = 0; i < numStates; i++) {
                    sum += alpha[t - 1][i] * a[i][k];
                }

                alpha[t][k] = sum * b[k][o[t]];
            }
            scale(scaling, alpha, t);
        }
    }
918609
def apply_action action, street
      # puts "pfr: apply_action #{street}, #{action.inspect}"
      result = action[:result]
      player = action[:screen_name]
      if street == :preflop and [:pay, :pay_to, :neutral].member?(result) and @pfr_opportunity[player].nil?
        case result
        when :pay, :neutral
          @pfr_opportunity[player] = true
          @pfr_opportunity_taken[player] = false
        when :pay_to
          @hand_statistics.players.each {|each_player| @pfr_opportunity[each_player] ||= (each_player == player)}
          @pfr_opportunity_taken[player] = true
        end
      end
    end
1333146
def forward(self, step):
        
        x = self.pos_x + math.cos(math.radians(self.rotation)) * step
        y = self.pos_y + math.sin(math.radians(self.rotation)) * step
        prev_brush_state = self.brush_on
        self.brush_on = True
        self.move(x, y)
        self.brush_on = prev_brush_state
1360800
def _move(self, roll=0, pitch=0, gaz=0, yaw=0):
        '''
        
        '''
        self.send(at.PCMD(at.PCMD.flag.progressive, roll, pitch, gaz, yaw))
128815
function(action) {
            if(!this.gameOver){
                var result = this.player.update(action);
                if(result){

                    this.entityManager.update(this.player);
                    this.player.updateFov();

                    this.lighting.update();
                    this.renderer.setCenter(this.player.x, this.player.y);
                    this.renderer.draw();

                } else if(this.queueDraw){
                    this.renderer.draw();
                }
            }
            this.queueDraw = false;
        }
1351454
def white_move(self):
        
        move = self.player_white.generate_move(self.position)
        move = make_legal(move, self.position)
        self.position.update(move)
250982
private void switchToBackward() {
        assert(state == State.ITER_CHECK_FWD ||
                (state == State.ITER_IN_FCD_SEGMENT && pos == start) ||
                (state.compareTo(State.IN_NORM_ITER_AT_LIMIT) >= 0 && pos == 0));
        if(state == State.ITER_CHECK_FWD) {
            // Turn around from forward checking.
            limit = pos = iter.getIndex();
            if(pos == start) {
                state = State.ITER_CHECK_BWD;  // Check backward.
            } else {  // pos > start
                state = State.ITER_IN_FCD_SEGMENT;  // Stay in FCD segment.
            }
        } else {
            // Reached the start of the FCD segment.
            if(state == State.ITER_IN_FCD_SEGMENT) {
                // The input text segment is FCD, extend it backward.
            } else {
                // The input text segment needed to be normalized.
                // Switch to checking backward from it.
                if(state == State.IN_NORM_ITER_AT_LIMIT) {
                    iter.moveIndex(start - limit);
                }
                limit = start;
            }
            state = State.ITER_CHECK_BWD;
        }
    }
822444
def move_origins(moves = nil)
      moves         ||= MOVES[move.piece.downcase]
      possibilities   = []
      file, rank      = destination_coords

      moves.each do |i, j|
        f = file + i
        r = rank + j

        if valid_square?(f, r) && self.board.at(f, r) == move.piece
          possibilities << [f, r]
        end
      end

      possibilities
    end
796821
def forward(self, data_batch, is_train=None):
        
        assert self.binded and self.params_initialized
        self.switch_bucket(data_batch.bucket_key, data_batch.provide_data,
                           data_batch.provide_label)
        self._curr_module.forward(data_batch, is_train=is_train)
641021
def forward(self, observations):
        
        input_data = self.input_block(observations)

        base_output = self.backbone(input_data)

        action_output = self.action_head(base_output)
        value_output = self.value_head(base_output)

        return action_output, value_output
286042
function forwardEvent(event, source, target) {
  function forward() {
    var listeners = target.listeners(event);

    var n = listeners.length;

    // Special case for `error` event with no listeners.
    if (n === 0 && event === 'error') {
      var args = [event];
      args.push.apply(args, arguments);

      target.emit.apply(target, args);
      return;
    }

    for (var i = 0; i < n; ++i) {
      listeners[i].apply(source, arguments);
    }
  }

  source.on(event, forward);

  // A reference to the function is necessary to be able to stop
  // forwarding.
  return forward;
}
623399
function nextTurn(game, player) {
    if (player.has_turn === false) {  // we assume that player has the turn
        return;
    }
    player.has_turn = false;

    // give next player the turn
    var _players = Object.keys(game.players);
    var next_idx = (_players.indexOf(player.name) + 1) %
        _players.length;
    var next = game.players[_players[next_idx]];
    next.has_turn = true;
    // next player draws new pieces
    next.pieces = next.pieces.concat(game.drawPieces(
        6 - next.pieces.length));
}
748845
public void step() {
        if (this.isSolved()) return;
        explain = true;
        session.setGlobal("explain", explain);
        this.counter.setCount(1);
        session.update(session.getFactHandle(this.counter), this.counter);
        if( steppingFactHandle == null ){
            steppingFactHandle = session.insert( stepping = new Stepping() );
        }
        this.session.fireUntilHalt();
        if( stepping.isEmergency() ){
            this.unsolvable = true;
        }
//        dumpGrid();
    }
521220
def _forward(self):
        
        try:
            self.current_token = next(self.tokens)
        except StopIteration:
            raise MissingTokensError("Unexpected end of token stream at %d." %
                self.current_pos)
        self.current_pos += 1