Question
A Sudoku Puzzle code in java needs help urgently ! 1. Implement the SudokuPuzzle class, here are the requirements: Use a 2D int array to
A Sudoku Puzzle code in java needs help urgently !
1. Implement the SudokuPuzzle class, here are the requirements:
-
Use a 2D int array to store the original values in the grid (you decide how to handle empty spaces).
-
Use another 2D int array to store the current values in the grid (so, the original values, plus any moves that have been made).
-
Use additional instance variables as needed, but try not to overdo it. Your code gets harder to maintain as you create more variables.
-
Only two of your methods are supposed to do any printing: displayGrid() and displayOriginal(). Don't put print statements in any other methods in the SudokuPuzzle class.
2. Write a LetsPlaySudoku class that allows the client to create a sudoku puzzle from a String array, and then uses a menu to allow the user to make moves, erase moves, and undo moves, among other things. See the sample runs at the end of this document. Your program should match the samples as closely as possible. Some things to note: You should use a loop to that displays the current grid, prints a menu, and asks the user for input. It should look like this:
Don't put all your code in the main() method. Break it into smaller methods to keep your logic more manageable, and easier to debug.
Sudoku puzzle source: https://www.123rf.com/photo_84057029_stock-vector-vector-sudoku-game-task-for-logic-mathematical-puzzle-with-the-answer-.html
The methods you may need:
CURRENT GRID** 01 2 3 4 5 6 7 8 0 6 1354|9I 119 5|8 4 3 6 4| 87 2 9 4 1 361 8 9| 613 117 2 | 7 6 84 19 3|1 6 1. write number 2. erase 3. undo 4. show grid 5. show original puzzle 6. erase all moves (cannot be undone) 7. quit Enter choice: | All Methods Instance Methods Modifier and Type Method void Concrete Methods displayGrid) Displays the current grid in rows and columns, in the format displayoriginal Displays the original grid in rows and columns, in the format erase(int row, Erase the value in the specified row and column, provided: 1. specified by the instructor. void specified by the instructor. boolean int col) void eraseAllMoves) Erases all moves from the grid, restoring the grid to the original puzzle. CURRENT GRID** 01 2 3 4 5 6 7 8 0 6 1354|9I 119 5|8 4 3 6 4| 87 2 9 4 1 361 8 9| 613 117 2 | 7 6 84 19 3|1 6 1. write number 2. erase 3. undo 4. show grid 5. show original puzzle 6. erase all moves (cannot be undone) 7. quit Enter choice: | All Methods Instance Methods Modifier and Type Method void Concrete Methods displayGrid) Displays the current grid in rows and columns, in the format displayoriginal Displays the original grid in rows and columns, in the format erase(int row, Erase the value in the specified row and column, provided: 1. specified by the instructor. void specified by the instructor. boolean int col) void eraseAllMoves) Erases all moves from the grid, restoring the grid to the original puzzleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started