Question: Write this program in JAVA (only JAVA solutions please!!). You can only import java.util.Scanner. Mentioned Pseudocode: you will write a program that calculates with brute

Write this program in JAVA (only JAVA solutions please!!). You can only import java.util.Scanner.

Write this program in JAVA (only JAVA solutions please!!). You can only

Mentioned Pseudocode:

import java.util.Scanner. Mentioned Pseudocode: you will write a program that calculates with

you will write a program that calculates with brute force whether a left-half 4x4 sudoku game that you will receive from the user can be solved by continuing it. Your program should receive the sudoku from the user as a keyboard entry in the format XXXX;XX XX;X X X X;X XXX Here, each line is separated from each other by a semicolon and each number is separated from each other by a space character. Empty tiles will be represented by an X. Each tile can take numbers 1-4. Sample input: XX 3 2; 3 2 4 1; XX 1 3;13 24 The sudoku represented by the input: 3 N 3 2 4 1 1 3 1 3 2 4 4 Your solution algorithm should work in a RECURSIVE and similar way to the pseudocode below for all the boxes reading respectively (line by line from left to right) starting from the box at the top left. If the given sudoku can be solved within the framework of the sudoku rules, the program should be terminated by pressing "Solvable!" on the screen, or "Unsolvable :(" if it cannot be solved. No output other than these phrases should be displayed on the screen. function solve_sudoku ( current_box_id > if all the boxes are filled return true; // solved! end // ignore already "filled" squares (assume they are correct!) if the current box is filled return the result of: solve_sudoku ( next box ); end // hypothesize all 4 possible numbers for each possible number from 1 to 4 if that number is 'valid' (okay to put in box) // test row, col, square try that number in the box if you can "solve_sudoka" for the rest of the puzzle return true; // success! end end end return false; // failure end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!