-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsudoku.h
36 lines (30 loc) · 1.33 KB
/
sudoku.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
#ifndef SUDOKU_HEADER
#define SUDOKU_HEADER
#include <string.h>
struct Board
{
unsigned int cell[9][9];
};
int solve(struct Board *board);
int recursiveSolve(struct Board *board, int depth);
int setCell(struct Board *board, unsigned int cell, int i, int j);
int getCell(struct Board *board, unsigned int *cell, int i, int j);
int checkRows(struct Board *board);
int checkCols(struct Board *board);
int checkBoxes(struct Board *board);
int checkDone(struct Board *board);
int init(struct Board *board);
int recursiveMask(struct Board *board, int row, int col, unsigned int mask);
int maskBoxExceptRow(struct Board *board, int row, int box, unsigned int mask);
int maskBoxExceptCol(struct Board *board, int col, int box, unsigned int mask);
int maskRowExceptBox(struct Board *board, int box, int row, unsigned int mask);
int maskColExceptBox(struct Board *board, int box, int col, unsigned int mask);
unsigned int getPosInRow(struct Board *board, int val, int row);
unsigned int getPosInCol(struct Board *board, int val, int col);
unsigned int getPosInBox(struct Board *board, int val, int box);
int otherLinesInBox(const int line, int *line1, int *line2);
unsigned int getBestGuess(struct Board *board, int *row, int *col);
//int getFirstUndecided(struct Board *board, int *row, int *col);
//unsigned int guess(unsigned int val);
#include "io.h"
#endif