Question: Create a class SudokuPuzzle that has the attributes board-a 9 by 9 array of integers that represents the current state of thepuzzle, where 0 indicates

Create a class SudokuPuzzle that has the attributes board-a 9 by 9 array of integers that represents the current state of thepuzzle, where 0 indicates a blank square start-a 9 by 9 array of boolean values that indicates which squares inboard are given values that cannot be changed and the following methods SudokuPuzzle-a constructor that creates an empty puzzle toString-returns a string representation of the puzzle that can be printed .addlnitial(row, col, value)-sets the given square to the given valueas an initial value that cannot be changed by the puzzle solver addGuess(row, col, value)-sets the given square to the given value,the value can be changed later by another call to addGuess .checkPuzzle-returns true if the values in the puzzle do not violate therestrictions getValueln(row, col)-returns the value in the given square getAllowedValues(row, col)-returns a one-dimensional array ofnine booleans, each of which corresponds to a digit and is true if thedigit can be placed in the given square without violating the restrictions isFull-returns true if every square has a value reset-changes all of the nonpermanent squares back to blanks (0s) Write a main method in the class Sudoku that creates a SudokuPuzzle object and sets its initial configuration. Then use a loop to allow someone to play Sudoku. Display the current configuration and ask for a row, column, and value. Update the game board and display it again. If the configuration does not satisfy the restrictions, let the user know. Indicate when the puzzle has been solved correctly. In that case, both checkPuzzle and isFull would return true. You should also allow options for resetting the puzzle and displaying the values that can be placed in a given square
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
