Sudoku Puzzle Project assignment help

computer science


public static void main(String[] args) {

Scanner reader = new Scanner(;

System.out.println("Sudoku Game: ");

SudokuPuzzle puzzle = new SudokuPuzzle();


System.out.print("The puzzle is: \n" + puzzle);

boolean done = false;


System.out.println("What would you like to do? \n" +

"Clear Puzzle(C) Set a square (S) Get possible values (G) Quit (Q) ");

String response =;

response = response.toLowerCase();


System.out.println("Thanks for playing.");

done = true;

} else if(response.equals("s")){

System.out.println("Which row (1-9) and colume (1-9) do you want to change?");

int row = reader.nextInt()-1;

int col = reader.nextInt()-1;

System.out.println("What should the value (1-9) be?");

int value = reader.nextInt();

puzzle.addGuess(row, col, value);

} else if(response.equals("g")){

System.out.println("Which row (1-9) and colume (1-9) do you want to get values for?");

int row = reader.nextInt()-1;

int col = reader.nextInt()-1;

boolean valid[] = puzzle.getAllowedValues(row, col);

System.out.print("Allowed values are: ");

for(int i=0; i<9; i++){


System.out.print((i+1)+ " ");



} else if(response.equals("c")){



System.out.print("The puzzle is now: \n" + puzzle);


System.out.println("You have made an error in the puzzle.");

else if(puzzle.isFull())

System.out.println("Congratulations, you have completed the puzzle.");

Related Questions in computer science category

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.