-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCase.h
52 lines (45 loc) · 1.04 KB
/
Case.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
47
48
49
50
51
52
#ifndef CASE_H
#define CASE_H
/**
* \def SIZE
* \brief The number of cells in a block
* \see Block
*/
#define SIZE 9
/**
* \def BLOCK
* \brief The square root of SIZE for the squared block
* \see SIZE
* \see Block
*/
#define BLOCK 3
/**
* \file "Case.h"
* \brief Defines cell's structures and resolving functions
* \author Mathieu L
* \version 1
*/
/**
* \typedef Cell
* \brief The structure of a cell : a value and a list of possible values
*/
typedef struct{
int value; /*!< Known value of the cell (0 if unknown value) */
int possibilities; /*!< Binary mask of the possibilities the cell can accept */
}Cell;
/**
* \typedef Block
* \brief A list of cells' pointers which cannot share a common value
*/
typedef struct{
Cell* cells[SIZE]; /*!< List of cells' pointers */
}Block;
/**
* \fn int getBits(int num)
* \brief Returns the number of bits with the value 1 in a number
* \param num
* Bitmask
* \return the number of bits with the value 1 in the bitmask
*/
int getBits(int num);
#endif // CASE_H