# Thread: Logic of loop example in C tutorials

1. ## Logic of loop example in C tutorials

In this segment of code Alex explains it's purpose:- "This way, if one player can't take her turn, the game doesn't stop for everybody; we just skip her and keep going with the next player's turn. "

I see this is implemented is lines 5 and 6, but what I don't understand exactly is what line 3 and 4 does.. mostly the conditional statement on line 3.

Code:
```1  for (player = 1; someone_has_won == FALSE; player++)
2  {
3        if (player > total_number_of_players)
4        {player = 1;}
5        if (is_bankrupt(player))
6        {continue;}
7        take_turn(player);
8  }```

2. Notice that the "increment" expression in the loop is player++. That increments player by 1 each time, so first it's 1, then 2, then 3, ...then 42, then 43, then 44....

Have you ever played monopoly with 44 people? Doubtful. So if total_number_of_players is 4, once player gets to 5, line 3 becomes true, line 4 is executed and player is reset back to 1.

3. Oh I didn't realize the int assigned to player was to distinguish each player from the others. Thank you.