title: How to check if board of game is entirely filled by players in C?
body: <p>I'm asked to create a mini-game in C;</p>
  
  <p>Basically, after the board of 5x5 size is full of 'X's and 'O's, program calculates the score for each player according to the shape of the figure. E.g. figure is as follows:</p>
  
  <pre><code>XXX
   X
  </code></pre>
  
  <p>Then it gives 1 point to one player or another.</p>
  
  <p>The program runs while the board is not completed. But when I enter let's say {1,1} first for player #1 then {5,5} for player #2 program just stops asking for more moves and exits the body of the loop (which likely is caused by wrong logic of while loop itself).</p>
  
  <p>So far what I did is created a board, players and their scores.</p>
  
  <pre><code>typedef struct{
    int row, column;
  }move;
  
  int main(){
  
    char board[5][5];
    int i,j;
    move playerA, playerB;
    int scoreOfPlayerA, scoreOfPlayerB;
  
    for(i=0;i&lt;5;i++){
        for(j=0;j&lt;5;j++){
            board[i][j] = '#';
        }
    }
  
    printf("Game started. Current state of the board: \n\n");
  
    for(i=0;i&lt;5;i++){
        for(j=0;j&lt;5;j++){
            printf("%c ", board[i][j]);
        }
        printf("\n\n");
    }
  
    printf("Do not forget to divide coordinates of your move by  comma!\n");
  </code></pre>
  
  <p>After the introduction, I took the values of movement from both players:</p>
  
  <pre><code>  for(i=0;i&lt;5;i++){
        for(j=0;j&lt;5;j++){
            while(board[i-1][j-1]=='#'){
                printf("A's Move: ");
                scanf("%i, %i", &amp;playerA.row, &amp;playerA.column);
                if(playerA.row&gt;5||playerA.column&gt;5){
                    printf("Invalid move! Board coordinates must be in [1,5]. Enter again.\n");
                    printf("A's Move: ");
                    scanf("%i, %i", &amp;playerA.row, &amp;playerA.column);
                }else if(board[playerA.row-1][playerA.column-1] != '#'){
                    printf("Position [%i,%i] is full! Enter again.\n", playerA.row, playerA.column);
                    printf("A's Move: ");
                    scanf("%i, %i", &amp;playerA.row, &amp;playerA.column);
              }
                board[playerA.row-1][playerA.column-1] = 'X';
                for(i=0;i&lt;5;i++){
                    for(j=0;j&lt;5;j++){
                        printf("%c ", board[i][j]);
                    }
                    printf("\n\n");
                }
  </code></pre>
  
  <p>So how one could modify the condition of while loop so that it would work correctly? </p>