Inline docstrings where return is void and method takes no parameters
This commit is contained in:
		
							parent
							
								
									196f066281
								
							
						
					
					
						commit
						a6dba79d9d
					
				
					 1 changed files with 11 additions and 27 deletions
				
			
		|  | @ -1,40 +1,34 @@ | |||
| package sudoku; | ||||
| 
 | ||||
| /** Solver is a class that implements the SudokuSolver interface */ | ||||
| public class Solver implements SudokuSolver { | ||||
|     private int[][] board = null; | ||||
|     private int tries = 0; | ||||
| 
 | ||||
|     /** Constructor */ | ||||
|     public Solver() { | ||||
|         board = new int[9][9]; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public void setBoard(int[][] board) { | ||||
|         this.board = board; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public int[][] getBoard() { | ||||
|         return board; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Resets the board to all zeros | ||||
|      */ | ||||
|     /** Resets the board to all zeros */ | ||||
|     @Override | ||||
|     public void clear() { | ||||
|         board = new int[9][9]; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /*{@inheritDoc} */ | ||||
|     @Override | ||||
|     public boolean solve() { | ||||
|         return solve(0, 0); | ||||
|  | @ -98,9 +92,7 @@ public class Solver implements SudokuSolver { | |||
|         randomizeBoard(3); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public void randomizeBoard(int difficulty) { | ||||
|         int amount_prefilled = (difficulty * 9) + 1; | ||||
|  | @ -121,9 +113,7 @@ public class Solver implements SudokuSolver { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public void set(int row, int col, int val) { | ||||
|         if (row < 9 && col < 9) { | ||||
|  | @ -131,9 +121,7 @@ public class Solver implements SudokuSolver { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public int get(int row, int col) { | ||||
|         if (row < 9 && col < 9) { | ||||
|  | @ -142,9 +130,7 @@ public class Solver implements SudokuSolver { | |||
|         return 0; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     @Override | ||||
|     public boolean isLegal(int row, int col, int num) { | ||||
|         // Sanity check | ||||
|  | @ -174,9 +160,7 @@ public class Solver implements SudokuSolver { | |||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
|      */ | ||||
|     /** {@inheritDoc} */ | ||||
|     public boolean isSolvable() { | ||||
|         // We want to work on a copy | ||||
|         int[][] copy = new int[9][9]; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus