Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- class Grid
- {
- public:
- bool checkPossible(unsigned int digit, unsigned int columnNr, unsigned int lineNr);
- bool checkFinished();
- void print();
- bool solve();
- private:
- unsigned int _grid[9][9] = {
- {5, 3, 10, 10, 7, 10, 10, 10, 10},
- {6, 10, 10, 1, 9, 5, 10, 10, 10},
- {10, 9, 8, 10, 10, 10, 10, 6, 10},
- {8, 10, 10, 10, 6, 10, 10, 10, 3},
- {4, 10, 10, 8, 10, 3, 10, 10, 1},
- {7, 10, 10, 10, 2, 10, 10, 10, 6},
- {10, 6, 10, 10, 10, 10, 2, 8, 10},
- {10, 10, 10, 4, 1, 9, 10, 10, 10}
- };
- //simple
- /*
- unsigned int _grid[9][9] =
- {
- {2, 6, 4, 8, 9, 1, 7, 5, 3},
- {9, 10, 5, 10, 3, 2, 1, 6, 4},
- {3, 1, 7, 6, 5, 4, 9, 2, 8},
- {6, 4, 1, 3, 2, 9, 5, 8, 7},
- {7, 9, 2, 4, 8, 5, 3, 1, 6},
- {5, 3, 8, 1, 6, 7, 2, 4, 9},
- {10, 2, 6, 9, 1, 3, 8, 7, 5},
- {1, 10, 9, 10, 10, 10, 6, 3, 2},
- {10, 10, 3, 2, 10, 6, 4, 9, 1}
- }; */
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement