-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
46 lines (38 loc) · 1012 Bytes
/
common.h
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
#ifndef KS_SUDOKE_SOLVER_COMMON
#define KS_SUDOKE_SOLVER_COMMON
#include <stdbool.h>
#include "sudoku_solver.h"
#define MIN_VALUE 1
#define MAX_VALUE 9
#define NUMBER_OF_VALUES 9
#define SQUARE_DIMENSION 3
/**** DEV ****/
//#define KS_SUDOKU_DEBUG
//#define KS_SUDOKU_DEBUG_NAKED_DOUBLE_SEARCH
//#define KS_SUDOKU_DEBUG_UPDATE_POSSIBILITIES_1
//#define KS_SUDOKU_DEBUG_UPDATE_POSSIBILITIES
//#define KS_SUDOKU_DEBUG_HIDDEN_SINGLE_SEARCH
/**** DEV *****/
/**
* Type to hold the possible values for a cell (identified by row and column).
*/
struct possible_entries
{
// an index is set to 'true' if the corresponding value is possible.
// Indexed from 1 to MAX_VALUE.
bool possible[MAX_VALUE+1];
// the number of possible values for a cell
unsigned possibilities;
};
/*
* Type to hold the naked double values.
*/
struct naked_double_values
{
unsigned vals[2];
};
/**
* Print the sudoku table to 'stdout'.
*/
void print_table(unsigned sudoku_table[TABLE_ORDER_MAX][TABLE_ORDER_MAX]);
#endif