//初始 public bool Init(int level, bool autoData = true) { _Level = level; _Level = _Level > 20 ? 20 : _Level; _values = new int[9, 9]; _sudokuGrid = null; if (autoData == false) { return(true); } //求解 this.InitValue(); //初始随机种子 if (this.Solve()) { Console.WriteLine(string.Format("MD5Hash: {0}", this.checkMD5Hash())); //按级别初始 bool bResult = this.InitValue_Space(_Level); this.Print(); //if (this.Solve()) //{ // Console.WriteLine(string.Format("MD5Hash: {0}", this.checkMD5Hash())); //} return(bResult); } return(true); }
//转换未图片 public bool SaveImage(string path, string name = "") { _sudokuGrid = new SudokuGrid(this); return(_sudokuGrid.InitValue() && _sudokuGrid.Save(path, name)); }