1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
////////////////////////////////////////////////////////////////////////
/// @file test_sudoku.cpp
/// @author CS 153 - A
/// @brief This file contains all the functions to test the sudoku class.
////////////////////////////////////////////////////////////////////////
#include "test_sudoku.h"
#include "sudoku.h"
using namespace std;
CPPUNIT_TEST_SUITE_REGISTRATION (Test_sudoku);
void Test_sudoku::solver ()
{
cout << "solve.....OK" << endl;
int puzzle[] = { 0, 1, 9, 0, 0, 2, 0, 0, 0,
8, 0, 0, 6, 9, 0, 0, 0, 0,
0, 5, 7, 4, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 7,
0, 0, 0, 3, 2, 5, 0, 0, 0,
4, 0, 0, 0, 0, 0, 8, 0, 0,
0, 0, 0, 0, 0, 8, 4, 5, 0,
0, 0, 0, 0, 5, 3, 0, 0, 8,
0, 0, 0, 9, 0, 0, 6, 1, 0 };
solve(puzzle);
for (int i =0; i <81; i++)
{
cout<< solve( puzzle[i]);
}
}
|