You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
intunique; /* if 1 after solving, puzzle has unique-choice solution */
15
+
} Grid_T;
16
+
17
+
typedefstructchoice_s {
18
+
inti,j,n; /* n is the value 1..9 of a choice for cell i,j. 0 means the cell is empty. */
19
+
} Choice_T;
20
+
21
+
Grid_Tgrid_init(Grid_Tg, intv[9][9]); /* init g with values from array v */
22
+
Grid_Tgrid_update(Grid_Tg, Choice_Tc); /* update value of c.i,c.j to c.n and eliminate c from choices in grid */
23
+
Choice_Tgrid_iterate(Grid_Tg, Choice_Tt); /* iterate over all choices in all cells starting from (t.i,t.j,t.n+1).If no choice is left, return (0,0,0) */
24
+
25
+
intgrid_unique(Grid_Tg); /* return unique flag for g */
26
+
Choice_Tgrid_exist_unique(Grid_Tg); /* return a cell with a unique choice, if one exists, otherwise return (0,0,0) */
27
+
Grid_Tgrid_clear_unique(Grid_Tg); /* clear unique flag */
28
+
29
+
Choice_Tgrid_read_value(Grid_Tg, Choice_Tc); /* return value of i,j */
0 commit comments