User feedback on unsolvable
This commit is contained in:
		
							parent
							
								
									2acf69d466
								
							
						
					
					
						commit
						3cf7005151
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		|  | @ -25,10 +25,16 @@ public class SudokuController { | |||
|             @Override | ||||
|             public void actionPerformed(ActionEvent e) { | ||||
|                 // Solve the board | ||||
|                 model.solve(); | ||||
|                 boolean solved = model.solve(); | ||||
|                 if (!solved) { | ||||
|                     view.showErrorMessage("Could not solve the board."); | ||||
|                     System.out.println("Could not solve the board."); | ||||
|                     System.out.println(model.toString()); | ||||
|                 } else { | ||||
|                     // Update the view | ||||
|                     view.updateView(model.getBoard()); | ||||
|                 } | ||||
| 
 | ||||
|                 // Update the view | ||||
|                 view.updateView(model.getBoard()); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus