Guest User

Untitled

a guest
Jan 23rd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #define SIZE 9
  2. #include <vector>
  3. using namespace std;
  4.  
  5. class SudokuGen
  6. {
  7. public:
  8. SudokuGen();
  9. void generator(); //亂數法產生新棋盤 (初始化時建構子就會呼叫一次)
  10. vector<int > get_board(); //輸出棋盤至vector變數
  11. bool check_rep(vector<int>,int,int); //偵測填入數字是否重複、符合規則,不符合會回傳false值
  12. bool board_put(vector<int>&); //填入數字函式,嘗試失敗超過1000次會回傳false值
  13. private:
  14. int new_board[SIZE][SIZE]; //棋盤
  15. int i,j,k,l; //迴圈用變數
  16. };
Add Comment
Please, Sign In to add comment