Pset03/Game Of Fifteen.cpp
void init(const int d , int board[][d])
{
    int inject = d*d-1;
    for(int r = 0 ; r < d ; r++)
    {
        for(int c = 0 ; c < d ; c++)
        {
            board[r][c]=inject;
            inject--;
        }
    }

    if(d%2==0) swap(&board[d-1][d-2], &board[d-1][d-3]);

}
/**
 * Initializes the game's board with tiles numbered 1 through d*d - 1
 * (i.e., fills 2D array with values but does not actually print them).
 */
Initializes the game's board with tiles numbered 1 through d*d - 1
.
Initializes the game ' s board with tiles numbered 1 through d * d - 1 .
void init(const int d , int board[][d])
{
    int inject = d*d-1;
    for(int r = 0 ; r < d ; r++)
    {
        for(int c = 0 ; c < d ; c++)
        {
            board[r][c]=inject;
            inject--;
        }
    }
    if(d%2==0) swap(&board[d-1][d-2], &board[d-1][d-3]);
}
void init ( const int d , int board [ ] [ d ] ) { int inject = d * d - 1 ; for ( int r = 0 ; r < d ; r ++ ) { for ( int c = 0 ; c < d ; c ++ ) { board [ r ] [ c ] = inject ; inject -- ; } } if ( d % 2 == 0 ) swap ( & board [ d - 1 ] [ d - 2 ] , & board [ d - 1 ] [ d - 3 ] ) ; }
Initializes the game's board with tiles numbered 1 through d*d - 1
 (i.e., fills 2D array with values but does not actually print them).
Initializes the game ' s board with tiles numbered 1 through d * d - 1 ( i . e . fills 2D array with values but does not actually print them ) .