Ejemplo n.º 1
0
int
main( int argc, char** argv )
{
  if ( argc < 2 )
  {
    std::cerr << "Usage: " << argv[0] << " <puzzle.txt>" << std::endl;
    return 1;
  }

  Puzzle* puzzle = new Puzzle( argv[1] );
  puzzle->print();

  Solver* solver = new Solver;
  solver->solve( *puzzle, true );

  delete solver;
  delete puzzle;
  return 0;
}
Ejemplo n.º 2
0
int main()
{
    Puzzle pzl;
    pzl.build();
    int iNumCase = 0;
    cin >> iNumCase;
    for(int i = 0; i < iNumCase; ++i)
    {
        vector< vector<char> > vPzl(3, vector<char>(3, '0'));
        for(int j = 0; j < 3; ++j)
        {
            for(int k = 0; k < 3; ++k)
            {
                cin >> vPzl[j][k];
            }
        }
        if(i > 0)
        {
            puts("");
        }
        pzl.print(vPzl);
    }
    return 0;
}