Pset03/Game Of Fifteen.cpp
bool won(const int d , int board[][d])
{
    int ci = 1;
    for (int r = 0 ; r < d ; r++)
    {
        for (int c = 0 ; c < d ; c++ , ci==d*d ? ci=0 : ci)
        {
            if(board[r][c]!=ci++) return 0;
        }
    }

    return 1;
}
/**
 * Returns true if game is won (i.e., board is in winning configuration),
 * else false.
 */
Returns true if game is won ,
else false.
Returns true if game is won else false .
bool won(const int d , int board[][d])
{
    int ci = 1;
    for (int r = 0 ; r < d ; r++)
    {
        for (int c = 0 ; c < d ; c++ , ci==d*d ? ci=0 : ci)
        {
            if(board[r][c]!=ci++) return 0;
        }
    }
    return 1;
}
bool won ( const int d , int board [ ] [ d ] ) { int ci = 1 ; for ( int r = 0 ; r < d ; r ++ ) { for ( int c = 0 ; c < d ; c ++ , ci == d * d ? ci = 0 : ci ) { if ( board [ r ] [ c ] != ci ++ ) return 0 ; } } return 1 ; }
Returns true if game is won (i.e., board is in winning configuration),
 else false.
Returns true if game is won ( i . e . board is in winning configuration ) else false .