con4lib.c
void print_board(const struct connect4 *game) {

    int i,j;

    printf("Here is the game board:\n\n");

    // Print the column numbers above the board.
    for (i=0; i<NUM_COLS; i++)
        printf("%d ", i);
    printf("\n");

    // Go through each row of the board.
    for (i=NUM_ROWS-1; i>=0; i--) {

        for (j=0; j<NUM_COLS; j++)
            printf("%c ",game->board[i][j]);
        printf("\n");
    }

    // Print the column numbers below the board.
    for (i=0; i<NUM_COLS; i++)
        printf("%d ", i);
    printf("\n");
}
// Prints out a representation of the current board
Prints out a representation of the current board
Prints out a representation of the current board
void print_board(const struct connect4 *game) {
    int i,j;
    printf("Here is the game board:\n\n");
    for (i=0; i<NUM_COLS; i++)
        printf("%d ", i);
    printf("\n");
    for (i=NUM_ROWS-1; i>=0; i--) {
        for (j=0; j<NUM_COLS; j++)
            printf("%c ",game->board[i][j]);
        printf("\n");
    }
    for (i=0; i<NUM_COLS; i++)
        printf("%d ", i);
    printf("\n");
}
void print_board ( const struct connect4 * game ) { int i , j ; printf ( " \n \n " ) ; for ( i = 0 ; i < NUM_COLS ; i ++ ) printf ( " " , i ) ; printf ( " \n " ) ; for ( i = NUM_ROWS - 1 ; i >= 0 ; i -- ) { for ( j = 0 ; j < NUM_COLS ; j ++ ) printf ( " " , game -> board [ i ] [ j ] ) ; printf ( " \n " ) ; } for ( i = 0 ; i < NUM_COLS ; i ++ ) printf ( " " , i ) ; printf ( " \n " ) ; }
Prints out a representation of the current board
Prints out a representation of the current board
// Print the column numbers above the board. // Go through each row of the board. // Print the column numbers below the board.