|
|
|
@ -2,6 +2,24 @@
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 测试输出数独矩阵
|
|
|
|
|
*/
|
|
|
|
|
void testPrintMatrix(){
|
|
|
|
|
int array[9][9] = {{5, 3, 0, 0, 7, 0, 0, 0, 0},
|
|
|
|
|
{6, 0, 0, 1, 9, 5, 0, 0, 0},
|
|
|
|
|
{0, 9, 8, 0, 0, 0, 0, 6, 0},
|
|
|
|
|
{8, 0, 0, 0, 6, 0, 0, 0, 3},
|
|
|
|
|
{4, 0, 0, 8, 0, 3, 0, 0, 1},
|
|
|
|
|
{7, 0, 0, 0, 2, 0, 0, 0, 6},
|
|
|
|
|
{0, 6, 0, 0, 0, 0, 2, 8, 0},
|
|
|
|
|
{0, 0, 0, 4, 1, 9, 0, 0, 5},
|
|
|
|
|
{0, 0, 0, 0, 8, 0, 0, 7, 9}};
|
|
|
|
|
SudokuMatrix* matrix = CreateMatrixFromArray(array);
|
|
|
|
|
PrintMatrix(matrix);
|
|
|
|
|
DeleteMatrix(matrix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 测试随机生成数独矩阵
|
|
|
|
|
*/
|
|
|
|
|