-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSudoku.cpp
30 lines (24 loc) · 1.09 KB
/
Sudoku.cpp
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
#include <iostream>
#include "sudoku_functions.h"
using namespace std;
//global initialization of board
int board[9][9];
int main ()
{
cout << "Hello World!" << endl;
board[9][9] = board_generation(board);
display_board(board);
//cout << validate_line(board) << endl;
board[9][9] = remove_invalids(board);
display_board(board);
//Don't call validate in main, validate should only be used in the backtracking function
//validate(board);
cout << "iteration 0 (raw/unclean)" << endl;
display_board(board);
cout << "iteration 1 (cleaned 1 time)" << endl;
clean(board);
display_board(board);
return 0;
}
//???? Limit to 3 per block, 3 per each row, 3 per each column? In order to generate something that could be a valid sudoku, then solve for it? Or re-gen?
//After testing, a significant portion obeying the above rule lead to valid, albeit brut-forced sudoku boards. We can conceal all invalid numbers from the sudoku board, then solve with backtrack algorithm, then if no solution exists we can cut down until there are 3 valids per row, column & block