コード例 #1
0
ファイル: Logic.cs プロジェクト: varu87/SuDoKu
 /// <summary>
 /// Generate the puzzle grid based on a difficulty level
 /// </summary>
 /// <param name="difficulty"></param>
 /// <returns>Grid</returns>
 public string[] GeneratePuzzle(Level difficulty)
 {
     string[] puzzle = new string[2];
     Grid grid = new Grid(difficulty);
     puzzle[0] = TerminalPattern(grid.GenerateTerminalPattern());
     puzzle[1] = PuzzleGrid(grid.DigHoles(RandomSequence()));
     return puzzle;
 }
コード例 #2
0
ファイル: Logic.cs プロジェクト: varu87/SuDoKu
 /// <summary>
 /// Generate the puzzle grid with an arbitrary number of 'givens'
 /// </summary>
 /// <returns>Grid</returns>
 public string GeneratePuzzle()
 {
     Grid grid = new Grid();
     grid.GenerateTerminalPattern();
     return PuzzleGrid(grid.DigHoles(RandomSequence()));
 }