-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
54 lines (51 loc) · 1.58 KB
/
main.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "defines.hpp"
#include "helperfuncs.hpp"
#include "solve.hpp"
#include <iostream>
int main() {
constexpr auto board_1 = board_from_string(
"2 3 0 4 1 5 0 6 8\n"
"0 8 0 2 3 6 5 1 9\n"
"1 6 0 9 8 7 2 3 4\n"
"3 1 7 0 9 4 0 2 5\n"
"4 5 8 1 2 0 6 9 7\n"
"9 2 6 0 5 8 3 0 1\n"
"0 0 0 5 0 0 1 0 2\n"
"0 0 0 8 4 2 9 0 3\n"
"5 9 2 3 7 1 4 8 6\n");
std::cout << "initial board:\n";
print_board(board_1);
std::cout << "solution:\n";
auto sol_1 = solve(board_1);
print_board(sol_1);
constexpr auto board_2 = board_from_string(
"3 0 6 5 0 8 4 0 0\n"
"5 2 0 0 0 0 0 0 0\n"
"0 8 7 0 0 0 0 3 1\n"
"0 0 3 0 1 0 0 8 0\n"
"9 0 0 8 6 3 0 0 5\n"
"0 5 0 0 9 0 6 0 0\n"
"1 3 0 0 0 0 2 5 0\n"
"0 0 0 0 0 0 0 7 4\n"
"0 0 5 2 0 6 3 0 0\n");
std::cout << "initial board:\n";
print_board(board_2);
std::cout << "solution:\n";
auto sol_2 = solve(board_2);
print_board(sol_2);
auto board_3 = board_from_string(
"6 0 0 0 5 8 0 0 0\n"
"9 0 0 0 0 4 2 8 7\n"
"0 3 4 7 2 1 9 0 0\n"
"5 4 0 0 7 6 0 0 9\n"
"2 8 0 0 0 0 7 0 1\n"
"0 0 0 0 3 0 0 0 4\n"
"0 0 0 0 0 0 0 1 0\n"
"0 6 5 0 1 3 0 0 8\n"
"0 1 2 0 0 0 3 0 6\n");
std::cout << "initial board:\n";
print_board(board_3);
std::cout << "solution:\n";
auto sol_3 = solve(board_3);
print_board(sol_3);
}