Advertisement
Guest User

Untitled

a guest
Oct 6th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #pragma once
  2. class Grid
  3. {
  4. public:
  5.     bool checkPossible(unsigned int digit, unsigned int columnNr, unsigned int lineNr);
  6.     bool checkFinished();
  7.     void print();
  8.     bool solve();
  9.  
  10. private:
  11.     unsigned int _grid[9][9] = {
  12.             {5, 3, 10, 10, 7, 10, 10, 10, 10},
  13.             {6, 10, 10, 1, 9, 5, 10, 10, 10},
  14.             {10, 9, 8, 10, 10, 10, 10, 6, 10},
  15.             {8, 10, 10, 10, 6, 10, 10, 10, 3},
  16.             {4, 10, 10, 8, 10, 3, 10, 10, 1},
  17.             {7, 10, 10, 10, 2, 10, 10, 10, 6},
  18.             {10, 6, 10, 10, 10, 10, 2, 8, 10},
  19.             {10, 10, 10, 4, 1, 9, 10, 10, 10}
  20.     };
  21.  
  22.     //simple
  23.     /*
  24.     unsigned int _grid[9][9] =
  25.     {
  26.         {2, 6, 4, 8, 9, 1, 7, 5, 3},
  27.         {9, 10, 5, 10, 3, 2, 1, 6, 4},
  28.         {3, 1, 7, 6, 5, 4, 9, 2, 8},
  29.         {6, 4, 1, 3, 2, 9, 5, 8, 7},
  30.         {7, 9, 2, 4, 8, 5, 3, 1, 6},
  31.         {5, 3, 8, 1, 6, 7, 2, 4, 9},
  32.         {10, 2, 6, 9, 1, 3, 8, 7, 5},
  33.         {1, 10, 9, 10, 10, 10, 6, 3, 2},
  34.         {10, 10, 3, 2, 10, 6, 4, 9, 1}
  35.     }; */
  36. };
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement