-
Notifications
You must be signed in to change notification settings - Fork 0
/
sudoku-db.c
executable file
·166 lines (161 loc) · 2.43 KB
/
sudoku-db.c
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#include<stdio.h>
/**
* Jeu du sudoku en mode console
*
* Data base statique de sudoku
**/
#if !defined(DB_TypeTyp) && !defined(DB_TypeVal)
# define DB_TypeTyp const char *
# define DB_TypeVal(v) #v
#elif defined(DB_TypeTyp) ^ defined(DB_TypeVal)
# error DB_Type[Typ|Val] doivent etre définis ensemble
#endif
typedef struct _TsudokuData {
DB_TypeTyp type; // le type/taille du sudoku
const char* solu; // le sudoku solutionné
const char* init; // le sudoku initial
} TsudokuData;
static const TsudokuData sudoku_t[] = {
{
//-----------------
DB_TypeVal(4x4),
"2143"
"4321"
"3214"
"1432"
,
"21.."
".32."
"...4"
"1..."
},{
DB_TypeVal(4x4),
"1234"
"4312"
"2143"
"3421"
,
"1.34"
".3.."
"2..."
"...1"
},
//-----------------
{
DB_TypeVal(6x6),
"652431"
"314625"
"436152"
"125364"
"243516"
"561243"
,
".5...1"
"..46.."
"4...5."
"1....4"
".43..."
".6.24."
},{
DB_TypeVal(6x6),
"534216"
"612435"
"126354"
"345621"
"261543"
"453162"
,
"5.4..."
"6...35"
"12...."
"...6.."
"..1..3"
"4.3.62"
},
//-----------------
{
DB_TypeVal(8x8),
"26234871"
"48175362"
"52768413"
"31486725"
"14827536"
"67351284"
"83642157"
"75213648"
,
".6.34..1"
"4...53.2"
"...6...."
".1...7.5"
"..82...."
".7....84"
"...4.1.."
".521.6.8"
},{
DB_TypeVal(8x8),
"85731624"
"61423578"
"27158346"
"48367215"
"72584163"
"13645782"
"36812457"
"54276831"
,
"....162."
"6.....78"
"..1.8..6"
"....72.5"
".258..6."
"...4.7.."
"..81..57"
"5.2...3."
},
//-----------------
{
DB_TypeVal(9x9),
"723846159"
"615392478"
"849715632"
"378654921"
"194287365"
"256931847"
"561479283"
"487123596"
"932568714"
,
"723...159"
"6..3.2..8"
"8...1...2"
".7.654.2."
"..42.73.."
".5.931.4."
"5...7...3"
"4..1.3..6"
"932...714"
},{
DB_TypeVal(9x9),
"327158946"
"619437582"
"548962713"
"186574329"
"432689157"
"975321468"
"764213895"
"851796234"
"293845671"
,
"..715.9.."
"..943...."
"5....2.13"
"..65.4.29"
"43..8..57"
"97.3.14.."
"76.2....5"
"....962.."
"..3.456.."
}
};
#undef DB_TypeTyp
#undef DB_TypeVAL